FileTools[Compressed] - Maple Help

Online Help

All Products    Maple    MapleSim


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

FileTools[Compressed]

  

ReadWriteFile

  

read a regular file and write it out as a compressed file

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

ReadWriteFile(target_filename, source_filename)

Parameters

target_filename

-

string, string in string, or integer file handle

source_filename

-

string or list of strings

Description

• 

ReadWriteFile is an all-in-one command to open a file, read all its data, compress, and write it out to another file.  This is done in small blocks, so the input data does not have to be read into the memory all at once.

• 

When target_filename is a zip file, the source_filename can be a directory.  In this case, the entire contents of that directory plus all subdirectories, are added to the zip archive.

• 

The in-zip file names are copied to match the on-disk filenames minus the base directory path.

• 

Since gzip format files cannot contain multiple sub-files, source_filename must be a single string.

Examples

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

zipfile:=/mnt/tmpfs/mpldoc_slot3/mpldoc2/GZtest-yYoYxV9R.zip

(1)

sourcedircatkerneloptsmapledir,/data/xml/schema

sourcedir:=/usr/local/repository/build/rdgetroll1/maple/slot1/data/xml/schema

(2)

FileTools:-Compressed:-ReadWriteFilezipfile,sourcedir

FileTools:-Compressed:-Contentszipfile

schema/worksheet/text.xsd,schema/worksheet/worksheet.dtd,schema/worksheet/rtables.xsd,schema/worksheet/plots.xsd,schema/worksheet/spread.xsd,schema/worksheet/worksheet.xsd,schema/worksheet/common.xsd,schema/worksheet/styles.xsd,schema/worksheet/options.xsd,schema/worksheet/containers.xsd,schema/mw/mw.xsd

(3)

FileTools:-Compressed:-Read("schema/worksheet/worksheet.xsd" in zipfile, string, 250);

<?xml version="1.0" encoding="UTF-8"?> <!-- ======================================================================= --> <!-- --> <!-- XML Schema for Maple Worksheets

(4)

FileTools&lsqb;Remove&rsqb;zipfile

Compatibility

• 

The FileTools[Compressed][ReadWriteFile] command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.

See Also

FileTools[Compressed]

FileTools[Compressed][WriteFile]

FileTools[Remove]

StringTools[FromByteArray]

 


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