Re: Saving sequences
- Posted by m_sabal Jul 02, 2009
- 1046 views
I thought print() and get() where only able to store/retrieve data in a flat format, meaning that the sequence structure would be lost? Am I wrong?
print() and get() work perfectly fine with sequence data, no matter how complex. Perhaps where you're getting confused is that print saves strings as a sequence of integers, instead of human readable text. get() is quite happy to read either string literals or sequences of integers. If the first character of your file is the open brace ({), and the last character is the close brace (}), you only need a single get() to retrieve the entire file. If the file was created with print(), that's what you'll see. I recommend experimenting with this a bit so you can see it for yourself. Remember that get() returns {GET_SUCCESS | GET_FAIL,data}.
The file created with print() is ASCII, and can easily be interpreted by anyone who understands the ASCII table. If the project requires compression and obfuscation, use database.e.