#1 Make libray work with reading from disc

Merged
necklace merged 1 commits from randomstuff/disc_size into necklace/master 4 years ago

Getting the file size with os.stat() does not work with block devices.

You can now:

  libray -i /dev/sg0 -o test.iso
Getting the file size with `os.stat()` does not work with block devices. You can now: libray -i /dev/sg0 -o test.iso

Thanks! I've been too lazy to check if reading directly from disc even works or not, but I've had it in the back of my head for a while. Good to know it doesn't work. I'll merge this but I'll be changing it a little and then make a release after testing some.

I think the original intent with using os.stat() was to avoid using open() on an empty file. No need to open an empty file, IMO. There probably should have been checks where core.filesize was used that would quit if the file was empty. I see I've also used it inconsistently before and after using open().

Thanks! I've been too lazy to check if reading directly from disc even works or not, but I've had it in the back of my head for a while. Good to know it doesn't work. I'll merge this but I'll be changing it a little and then make a release after testing some. I think the original intent with using `os.stat()` was to avoid using `open()` on an empty file. No need to open an empty file, IMO. There probably should have been checks where `core.filesize` was used that would quit if the file was empty. I see I've also used it inconsistently before and after using `open()`.
This pull request has been merged successfully!
Sign in to join this conversation.
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.