FileTools[Text]
Close
close a text file
Calling Sequence
Parameters
Description
Examples
Close(file, file2, ...)
file1, file2, ...
-
one or more names or file descriptors of open files to be closed
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.
testfile≔FileToolsJoinPath⁡FileToolsTemporaryDirectory⁡,test
testfile≔/tmp/test
FileToolsTextOpen⁡testfile
0
FileToolsTextWriteString⁡testfile,This is a test\n
15
FileToolsTextClose⁡testfile
See Also
file
file_types
FileTools[Text][Open]
FileTools[Text][WriteString]
IO_errors
Download Help Document