Fcreate
Create File
Fcreate() Opcode = 60 ($3C)
Creates a new file, or if the specified file already exists, truncates it to
length 0. The file is opened, and a 16-bit handle is returned that can be
used for further access to the file, f w-
C macro format
char *fname;
int handle, attr;
handle = Fcreate(fname, attr);
Machine language format
move.w attr, - (sp)
fname, - (sp)
#$3C, - (sp)
#1
#8,sp
A flag that specifies the file's attributes.
move.l
move.w
trap
addq.l
Inputs
attr word
Interpretation of attr flag:
Bit Number Bit Value Description
0 1 Read-only file (can't be deleted or written to)
1 2 Hidden file (excluded from normal directory
searches)
2 4 System file (excluded from normal directory
searches)
3 8 Volume label (can only exist in root)
fname long A pointer to a null-terminated ASCII
string containing the name of the file to
create.
Results
DO handle
See also
Fopen()
word If the function succeeds, a 16-bit handle value. If
not, a negative GEMDOS error number.
270