FileTools[Text] - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Input and Output : File Manipulation : FileTools : FileTools/Text/Close

FileTools[Text]

  

Close

  

close a text file

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Close(file, file2, ...)

Parameters

file1, file2, ...

-

one or more names or file descriptors of open files to be closed

Description

• 

The Close(file) command closes the specified file, which is assumed to have been opened implicitly by a FileTools[Text] function or by Open.

• 

The Close function does not return anything.

• 

Closing a file ensures that all data is written to disk.

• 

When exiting Maple by using the quit, done, or stop command, all open files are automatically closed.

• 

Closing a file that is not open raises an error.

Examples

testFileFileTools[JoinPath]FileTools[TemporaryDirectory],test

testFile:=/tmp/test

(1)

FileTools[Text][Open]testFile

0

(2)

FileTools[Text][WriteString]testFile,This is a test

15

(3)

FileTools[Text][Close]testFile

See Also

file

file_types

FileTools[Text]

FileTools[Text][Open]

FileTools[Text][WriteString]

IO_errors

 


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