Thank you very much. I have managed to get the IO package to work using xz compression.
Best wishes, Raphael On Wed, 15 Apr 2020 at 12:38, Frank Lübeck <[email protected]> wrote: > > On Tue, Apr 14, 2020 at 08:23:51PM +0100, Raphael C wrote: > > I am making a large DFA and would like to compress it before writing > > it to a file. I tried the following: > > > > dfa := RemovedSinkStates(NFAtoDFA(nfa)); > > output := OutputTextFile("test.gz", false); > > AppendTo(output, dfa); > > CloseStream(output); > > > > But the file test.gz is not compressed. > > > > I was attempting to follow the instructions from > > https://www.gap-system.org/Manuals/doc/ref/chap10.html . > > > > How should this be done? > > > > Raphael > > Dear Raphael, dear Forum, > > Indeed, the documentation (or implementation) of InputTextFile and > OutputTextFile seems wrong. Either the documentation or the implementation > should be fixed. > > For writing data into compressed files I usually use the IO package, see > > ?IO: Using filters when reading or writing files sequentially > > in the GAP help system. This can also be used for other types of filter > programs, not just gzip. > > I'm also sometimes reading GAP code (usually large amounts of data) from > compressed files. This works as follows. > > The command > > Read("guck.g"); > > just reads the file as GAP code if it exists. If the file does not exist, > then GAP checks if there is a file "guck.g.gz". If yes, GAP transparently > decompresses the file and reads the result. If not, an error is raised. > > The same behaviour can be observed with > > inp := InputTextFile("guck.g"); > Read(inp); > > I cannot find a documentation of this behaviour. It should probably be > added. > > Best regards, > Frank > > -- > /// Dr. Frank Lübeck, Lehrstuhl D für Mathematik, Pontdriesch 14/16, > \\\ 52062 Aachen, Germany > /// E-mail: [email protected] > \\\ WWW: http://www.math.rwth-aachen.de/~Frank.Luebeck/ _______________________________________________ Forum mailing list [email protected] https://mail.gap-system.org/mailman/listinfo/forum
