FileTools/Text/ReadFile - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : FileTools/Text/ReadFile

FileTools[Text]

  

ReadFile

  

read all lines from a file

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

ReadFile(file)

Parameters

file

-

file descriptor or filename

Description

• 

The ReadFile(file) command reads a string containing all the characters in the file.  For files previously opened, the result string contains all the characters from the current file position to the end of file. The characters are returned as a string.

• 

If the file is not open prior to calling ReadFile then it will be closed before returning.  If the file was already open it will not be closed.

Examples

FileToolsTextWriteLinetestfile,This is a test

15

(1)

FileToolsTextWriteLinetestfile,This is also a test

20

(2)

FileToolsTextClosetestfile

FileToolsTextReadFiletestfile

This is a test This is also a test

(3)

FileToolsRemovetestfile

See Also

file

FileTools[Remove]

FileTools[Text]

FileTools[Text][Close]

FileTools[Text][Open]

FileTools[Text][ReadLine]

FileTools[Text][WriteLine]

FileTools[Text][WriteString]

IO_errors

readline