I have implemented an Import|Export format for xz that behaves like gzip and other encoding formats:


But I think I did it in a really roundabout way, is there a more straightforward way than adding DownValues for all these things:

ImportExport`EncodingsDump`rundecoder["XZ", infile_String, outfile_String, opts___]
ImportExport`EncodingsDump`runencoder["XZ", infile_String, outfile_String, opts___]
FileFormatDump`$FILEFORMATMATRIX["XZ"] (* $ /mma.SE bug *)
ImportExport`EncodingsDump`CreateShortName[infile_ /; StringMatchQ[infile, "*.xz"]]
AppendTo[FileFormatDump`$FILEFORMATS, "XZ"]

Together with:

ImportExport`RegisterImport["XZ", ImportXZ,
 (* Similar for Export *)

What's the best way to do this?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.