FileTools[Compressed]
Write
write data to a compressed file
Calling Sequence
Parameters
Description
Examples
Compatibility
Write(file, data)
file
-
string or integer file descriptor
data
string or rtable of hardware datatype numbers
The Write command compresses and writes data to a file that has been opened with FileTools[Compressed][Open].
file≔FileToolsTemporaryFilename⁡FileToolsJoinPath⁡FileToolsTemporaryDirectory⁡,GZtest-
file≔/tmp/mpldoc1/GZtest-yYoYxV9R
fd≔FileToolsCompressedOpen⁡file
fd≔13506576
FileToolsCompressedWrite⁡fd,String1
7
data≔StringToolsToByteArray⁡String2
data≔8311611410511010350
FileToolsCompressedWrite⁡file,data
FileToolsCompressedClose⁡fd
0
FileToolsCompressedReadFile⁡file,string
String1String2
FileToolsRemove⁡file
zipfile≔FileToolsTemporaryFilename⁡cat⁡FileToolsTemporaryDirectory⁡,kernelopts⁡dirsep,GZtest-,.zip
zipfile≔/tmp/mpldoc1/GZtest-bx70dpPu.zip
fd := FileTools[Compressed][Open]("dataOne" in zipfile,'mode'=WRITE);
fd≔0
FileToolsCompressedWrite⁡fd, String2
8
FileTools[Compressed][ReadFile]("dataOne" in zipfile, string);
String1 String2
FileToolsRemove⁡zipfile
The FileTools[Compressed][Write] command was introduced in Maple 16.
For more information on Maple 16 changes, see Updates in Maple 16.
See Also
FileTools[Compressed][Close]
FileTools[Compressed][Open]
FileTools[Compressed][Read]
FileTools[Compressed][ReadFile]
FileTools[Remove]
Download Help Document