gap-packages / io

GAP package IO to do input and output
https://gap-packages.github.io/io/
Other
14 stars 14 forks source link

Add a convenience method for reading and writing compressed files #13

Closed ChrisJefferson closed 10 years ago

ChrisJefferson commented 10 years ago

This commit adds IO_CompressedFile, a convenience function which automatically reads and writes compressed files.

I also remove a whole bunch of dangling whitespace, which should possibly be in a separate commit but I couldn't figure out how to separate the two, so you can either have dangling whitespace everywhere including my code, or nowhere...

ChrisJefferson commented 10 years ago

Updated -- this now includes 3 changes.

1) Whitespace removal

2) A patch to fix the bug that IO's buffers are not flushed on GAP exit

3) IO_CompressedFile

fingolfin commented 10 years ago

Overall, this looks good to me. Of course we may want to enhance IO_CompressedFile in the future (e.g. an optional parameter that specifies the compression type for writing, instead of guessing based on the filename, might be useful; and for reading, it would in principle be possible to detect the compressed file format by inspecting the first few bytes of the file; etc.).

But for now, I see no reason to delay this patch further only because in the future other things "may" happen... :-)

Thanks, Chris!