ulikunitz/xz

Expose `processFile` function

rzhade3 opened this issue · 2 comments

It would be helpful (for my use case) to export a function that performs the same behavior as the gxz command line utility so that it can be called programmatically. This would de-dupe the file read/ write logic that has already been written for the command line utility, allowing for more programmatic usage of this library.

Would this be a desirable addition?

This was attempted, incorrectly, in #48.

Hi, I don't think so. It would widen the API and would need to be supported forever. Compression packages support usually a reader and a writer. These reader and writers can then be used in combination with all the mechanisms in the io package including Copy and ReadAll. Readers and Writers are extremely simple and provide a lot of flexibility, which a processFile function would not provide.

Got it, thanks for the conversation. I'll close out this feature request then!