FileTools[Compressed]
Read
read from a compressed file
Calling Sequence
Parameters
Description
Examples
Compatibility
Read(file, type, number)
file
-
string or integer file descriptor
type
string or a hardware number type to read
number
number of characters or numbers to read
The Read command reads a fixed amount of data from a file that has been opened with FileTools[Compressed][Open].
file≔FileToolsTemporaryFilename⁡FileToolsJoinPath⁡FileToolsTemporaryDirectory⁡,GZtest-
file≔/tmp/mpldoc4/GZtest-yYoYxV9R
data≔LinearAlgebraRandomVector⁡100,datatype=float8
FileToolsCompressedWriteFile⁡file,data
800
fd≔FileToolsCompressedOpen⁡file
fd≔20128752
FileToolsCompressedRead⁡fd,float8,11
−55.
FileToolsCompressedRead⁡file,float8,99
17.−35.36.71.75.47.−15.−48.−38.−80.48.−13.76.5.−2.5.92.74.−24.−28.−63.−19.−74.83.95.25.−69.27.16.83.81.38.−63.1.−25.−95.−77.−49.−24.−66.−28.−47.87.−99.77.8.−33.49.−63.−25.−1.−31.−88.64.−62.4.69.−63.−87.−34.64.81.25.65.98.51.11.51.95.−11.34.46.9.50.−43.−67.19.29.−12.96.93.−80.−92.−29.96.89.−55.−67.77.−70.13.−58.−94.−7.12.−53.21.−25.40.
FileToolsCompressedClose⁡fd
0
FileToolsRemove⁡file
zipfile≔FileToolsTemporaryFilename⁡cat⁡FileToolsTemporaryDirectory⁡,kernelopts⁡dirsep,GZtest-,.zip
zipfile≔/tmp/mpldoc4/GZtest-AyUYslLY.zip
FileTools[Compressed][WriteFile]("sample" in zipfile, "A sample message");
16
fd := FileTools[Compressed][Open]("sample" in zipfile,'mode'=READ);
fd≔1
FileToolsCompressedRead⁡fd,string,8
A sample
message
FileToolsRemove⁡zipfile
The FileTools[Compressed][Read] 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][Write]
FileTools[Compressed][WriteFile]
FileTools[Remove]
Download Help Document