Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>fopen()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
FOPEN()


Syntax:     FOPEN(<expC> [,<expN>])

Purpose:    To open a file.

Arguments:  <expC> is the name of the file to open including the
            path if there is one.

            <expN> is the requested DOS open mode indicating how the
            open file can be accessed.  Access falls into three
            categories:

            Table: DOS File Open Modes
            -----------------------------------------------------
            Open Mode      Operation
            -----------------------------------------------------
               0           Read only
               1           Write only
               2           Read/write
            -----------------------------------------------------

            The default sharing open mode is zero.

Returns:    A numeric value.

            FOPEN() returns the file handle of the opened file in the
            range of zero to 65,535.  If an error occurs, FOPEN()
            returns -1.

Usage:      Since a file handle is required in order to identify an open
            file to other file functions, always assign the return value
            from FOPEN() to a memory variable for later use.

            Accessing files in other directories: FOPEN() does not
            obey either the DEFAULT or PATH SETtings.  Instead, it only
            searches the current directory unless a path is explicitly
            stated.

Library:    EXTEND.LIB

            Warning: These functions allow low level access to DOS
            files and devices.  They should be used with extreme care
            and require a thorough knowledge of the operating system.


----------------------------------- Example --------------------------------

   handle = FOPEN("Temp.txt")
   IF FERROR() <> 0
      ? "Cannot open file, DOS error ", FERROR()
   ENDIF




See Also: FCLOSE() FCREATE() FERROR()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson