#1 Make libray work with reading from disc

已合并
necklace 6 年之前 将 1 次代码提交从 randomstuff/disc_size合并至 necklace/master

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
Nichlas Severinsen 评论于 6 年之前
所有者

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()`.
该合并请求已经成功合并!
登录 并参与到对话中。
未选择里程碑
未指派成员
2 名参与者
正在加载...
取消
保存
这个人很懒,什么都没留下。