[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|             FFLUSH              |
+---------------------------------+
FFLUSH(<expN>)

-----------------------------------
Flushes to disk a file opened with low-level file function.
Return value - Logical
-----------------------------------

The FFLUSH() function flushes the file whose handle is <expN>.  FFLUSH()
frees the memory that is used by the file's buffer in both read and
write operations.  If the file was written to, FFLUSH() writes all data
to disk.

The FLUSH command does not operate on files opened with the low-level
file functions (FOPEN() or FCREATE()).

<expN>
        File handle of file to flush to disk.

+---------------------------------+
|         Program Example         |
+---------------------------------+
The example below opens INPUT.DAT file (creating it if necessary), and
writes to it.  After writing first two strings, program flushes buffers
to ensure that strings are written to disk.  It then writes next two
strings, flushes buffers again, and closes file.

IF FILE('input.dat')
        test_file = FOPEN('input.dat',2)
ELSE
        test_file = FCREATE('input.dat')
ENDIF

io_bytes = FWRITE(test_file,'Test output')
io_bytes = FWRITE(test_file,' for low level file I/O')
flush_ok = FFLUSH(test_file)

io_bytes = FWRITE(test_file,'Test output2')
io_bytes = FWRITE(test_file,' for low level file I/O')
flush_ok = FFLUSH(test_file)

close_ok = FCLOSE(test_file)

-----------------------------------

See Also:  FCHSIZE(), FCLOSE(), FCOUNT(), FCREATE(), FEOF(), FERROR(),
FGETS(), FOPEN(), FPUTS(), FREAD(), FSEEK(), FSIZE(), FWRITE()

-----------------------------------

See Also: FCHSIZE() FCLOSE() FCOUNT() FCREATE() FEOF() FERROR()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson