Topic : The ATARI Compendium
Author : Scott Sanders / JAY Software
Version : 1.25 (20/6/2003)
Subject : Documentation
Nodes : 1117
Index Size : 32614
HCP-Version : 6
Compiled on : Atari
@charset : UTF-8
@lang : en
@default :
@help : %About
@options : +g -i -t4 +y +z
@width : 100
View Ref-FileFopen()Fclose()Fcreate() GEMDOSSyntaxLONG Fcreate( fname, attr )
char *fname;
WORD attr;
Function Fcreate() creates a new file (or truncates an existing one)
with the specified name and attributes.
Opcode 60 (0x3C)
Availability All GEMDOSversions.
Parameters fname is a character pointer to the GEMDOS file specification
of the file to create or truncate. attr is a bit array which
specifies the attributes of the new file. Valid mask values
are given below:
Name Bit Meaning
FA_READONLY 0 Read-only file
FA_HIDDEN 1 Hidden file
FA_SYSTEM 2 System file
FA_VOLUME 3 Volume label
- 4 Reserved
FA_ARCHIVE 5 Archive bit
Binding move.w attr,-(sp)
pea fname,-(sp)
move.w #$3C,-(sp)
trap #1
addq.l #8,sp
Return Value Fcreate() returns a LONG value. If the LONG is negative, it
should be interpreted as a GEMDOS error. Possible errors are
EPTHNF (-34), ENHNDL (-35) , or EACCDN (36). If positive, the
WORD portion of the returned LONG should be regarded as the
file handle.
Caveats With GEMDOS version 0.13, creating a read-only file returns
a read-only file handle which is of little use. GEMDOSversions below 0.15 incorrectly allow more than one volume
label per disk.
Comments GEMDOSversions 0.15 and above automatically set the archive
bit. You may set it yourself on versions below 0.15.
See Also Fopen(), Fclose()