[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
FCREATE()

    FCREATE() creates a new file or truncates an existing file to zero
    length.

Syntax

    FCREATE(<expC>[,<expN>])

Argument

    <expC> is the name of the file to create.

    <expN> is the DOS file attribute.  If omitted, the default is zero.

                             DOS File Attributes

    Value    Attribute     Description
      0      Normal        Read/write
      1      Read only     Attempting to open for output returns an error.
      2      Hidden        Excluded from normal directory searches.
      3      System        Excluded from normal directory searches.

Returns

    A numeric value.

    FCREATE() returns the DOS file handle number of the new file in the
    range of zero to 65,535.  If an error occurs, it returns -1.

Usage

    When FCREATE() successfully creates a new file, it is left open with a
    DOS open mode of 2 (mode 2 is compatibility sharing mode, read/write
    access mode).

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

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

Example

    handle = FCREATE("Testfile", 0)

WARNING: This function allows low level access to DOS files & devices.
             They should be used with extreme care and require a thorough
             knowledge of the operating system.

See Also: FCLOSE FERROR FOPEN FREAD FREADSTR FSEEK FWRITE
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson