Re: Saving a sequence
- Posted by SDPringle Jan 23, 2015
- 1299 views
GreenEuphorian said...
A recent contribution to the Archive (the XML-to-sequence library) made me wonder about the ways of saving sequences to disk, for later retrieval. Is there a standard way of doing it? And is there anything like sequence-to-XML or similar?
Thanks
Green Euphorian
The standard way is to use print and get from std/get.e. These store in a kind of ASCII format. I say "kind of" because you can store any sequence this way not just ASCII strings.
output:
print(fd, obj) puts(fd, 10)
input:
obj = get(fd)
I sometimes had problems when I didn't add a newline after printing.