barneygale / isoparser

Parser for the ISO 9660 disk image format
Other
29 stars 22 forks source link

Fix: source.FileStream to process directly file streams #17

Closed fcosantos closed 6 years ago

fcosantos commented 6 years ago

Currently if you use FileStream with an already open file stream fails, this patch allow you to use it. Example:

raw_iso9660 = open('iso', 'rb')
raw_iso9660.seek(-1)
size = raw_iso9660.tell()

file_stream = isoparser.source.FileStream(raw_iso9660, 0, size)
iso = isoparser.iso.ISO(file_stream)

print iso
print iso.record().children
barneygale commented 6 years ago

Thanks very much for this! All looks good to me.

barneygale commented 5 years ago

FYI I've reverted the commit as this looks like a mistake in your code - the FileStream class is not meant to be used for this. Does a FileSource not work?