fopen
|
File Input/Output functions |
SYNTAX | fopen( ''filename'', ''mode'', shared = False ) |
RETURNS | FILE handle |
FUNCTION | Opens file, returns filehandle (NUMBER). File handle is non-zero if file opened successfully, zero on failure. Parameters:
When sharing parameter is True the following things happen:
When sharing parameter is set to False (default) no such checking occurs and file is open anyway without denying others to read/write. This may cause data corruption if file is written to from multiple threads/external processes at the same time. If you want to use this mode (sharing set to False) in multithreaded environment to write data, you need to care about synchronization yourself for example using critical section. |
EXAMPLE | fh = fopen( "myfile.txt", "w"); |
SEE ALSO | fclose() function , fputs() function , fgets() function |
The fopen function is used in the following formulas in AFL on-line library:
See updated/extended version on-line.