FileTools[Compressed] - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Input and Output : File Manipulation : FileTools : FileTools/Compressed/Read

FileTools[Compressed]

  

Read

  

read from a compressed file

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Read(file, type, number)

Parameters

file

-

string or integer file descriptor

type

-

string or a hardware number type to read

number

-

number of characters or numbers to read

Description

• 

The Read command reads a fixed amount of data from a file that has been opened with FileTools[Compressed][Open].

Examples

fileFileTools[TemporaryFilename]catFileTools[TemporaryDirectory],kerneloptsdirsep,GZtest-

file:=/mnt/tmpfs/mpldoc_slot4/mpldoc2/GZtest-h9gGbgMG

(1)

dataLinearAlgebra[RandomVector]100,datatype=float[8]

data:= 1 .. 100 VectorcolumnData Type: float8Storage: rectangularOrder: Fortran_order

(2)

FileTools[Compressed][WriteFile]file,data

800

(3)

fdFileTools[Compressed][Open]file

fd:=22281648

(4)

FileTools[Compressed][Read]fd,float[8],11

4.

(5)

FileTools[Compressed][Read]file,float[8],99

1 .. 99 ArrayData Type: float8Storage: rectangularOrder: Fortran_order

(6)

FileTools[Compressed][Close]fd

0

(7)

FileTools[Remove]file

zipfileFileTools[TemporaryFilename]catFileTools[TemporaryDirectory],kerneloptsdirsep,GZtest-,.zip

zipfile:=/mnt/tmpfs/mpldoc_slot4/mpldoc2/GZtest-ZdOP0zdB.zip

(8)

FileTools[Compressed][WriteFile]("sample" in zipfile, "A sample message");

16

(9)

fd := FileTools[Compressed][Open]("sample" in zipfile,'mode'=READ);

fd:=1

(10)

FileTools[Compressed][Read]fd,string,8

A sample

(11)

FileTools[Compressed][Read]fd,string,8

message

(12)

FileTools[Compressed][Close]fd

0

(13)

FileTools[Remove]zipfile

Compatibility

• 

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]

FileTools[Compressed][Close]

FileTools[Compressed][Open]

FileTools[Compressed][Write]

FileTools[Compressed][WriteFile]

FileTools[Remove]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam