flush output for a buffered file - Maple Help

Online Help

All Products    Maple    MapleSim


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

FileTools[Flush] - flush output for a buffered file

Calling Sequence

Flush(file, file2, ...)

Parameters

file1, file2, ...

-

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

Description

• 

The Flush(file1, file2, ...) command ensures that output, which has been written to the specified files that are assumed to have been opened either implicitly, by Text[Open] or by Binary[Open], is written to disk.

• 

The Flush function does not return anything.

• 

When a file is closed, it is automatically flushed.

Examples

FileTools[Text]OpentestFile:

FileTools[Text]WriteStringtestFile,This is a test

15

(1)

ifkerneloptsplatform=windowsthenssystem`type testFile`elsessystem`cat testFile`end if

0,

(2)

FileTools[Flush]testFile

ifkerneloptsplatform=windowsthenssystem`type testFile`elsessystem`cat testFile`end if

0,This is a test

(3)

FileTools[Text]ClosetestFile

See Also

file_types, FileTools, FileTools[Binary][Close], FileTools[Binary][Open], FileTools[Text][Close], 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