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
Pingback: Harbour All Functions – F | Viva Clipper !
Pingback: Harbour Files and Folders Functions | Viva Clipper !
Pingback: Harbour RG Summary | Viva Clipper !