FCreate()

FCREATE()

Creates a file for low-level access

Syntax

      FCREATE( <cFile>, [<nAttribute>] ) --> nHandle

Arguments

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

<nAttribute> Numeric code for the file attributes.

Returns

<nHandle> Numeric file handle to be used in other operations.

Description

This function creates a new file with a filename of <cFile>. The default value of <nAttribute> is 0 and is used to set the attribute byte for the file being created by this function. The return value will be a file handle that is associated with the new file. This number will be between zero to 65, 535, inclusive. If an error occurs, the return value of this function will be -1.

If the file <cFile> already exists, the existing file will be truncated to a file length of 0 bytes.

If specified, the following table shows the value for <nAttribute> and their related meaning to the file <cFile> being created by this function.

       <nAttribute>   fileio.ch     Meaning
       -------------  ------------- ---------------------------------------      
       0              FC_NORMAL     Normal/Default,Read/Write
       1              FC_READONLY   Read-only file attribute is set
       2              FC_HIDDEN     Hidden,Excluded from normal DIR search
       4              FC_SYSTEM     Create,Excluded from normal DIR search

Examples

      #include "fileio.ch"
      IF ( nh := FCreate( "test.txt" ) ) == F_ERROR
          ? "Cannot create file"
      ENDIF

Compliance

Clipper

Files

Library is rtl Header is fileio.ch

Seealso

FCLOSE(), FOPEN(), FWRITE(), FREAD(), FERROR()

Advertisements

3 responses to “FCreate()

  1. Pingback: Harbour All Functions – F | Viva Clipper !

  2. Pingback: Harbour Files and Folders Functions | Viva Clipper !

  3. Pingback: Harbour RG Summary | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s