Atari ST series Technical Reference Manual page 137

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

GEMDOS File System Functions
int status;
char '''filename;
status = Fdelete(filename);
where filename is a pointer to a null-terminated ASCII string
that contains the name of the file to be deleted. If the file is
successfully deleted, a 0 is returned in status. If the operation
fails, a negative error number is returned instead.
Renaming a file is the job of a function called Frename():
int status;
char *oldname;
char *newname;
status = Frename (0, oldname, newname);
where oldname is a pointer to a string containing the name of
the file to be changed, and newname is a pointer to the string
containing the new name. Wildcard characters may not be
present in either the source or destination filenames. The
destination filename may, however, be in another directory,
which effectively "moves" the file from one directory to the
other. Of course, you can't rename a file to another directory
if that directory already contains a file of the same name.
Note that a dummy 16-bit 0 argument must be used at the
beginning of the call as a place holder. If the rename opera­
tion is successful, a 0 is returned in status. If the operation
fails, a negative error code is returned.
It is possible to read or change a file's attributes with the
Fattrib() function. The function is called like this:
int attributes, mode, newattr;
char ^filename;
attributes = Fattrib(filename, mode, newattr);
Fattrib() sets or gets the attributes of the file whose
name is contained in the string pointed to by filename, ac­
cording to the setting of mode. If mode is set to one, the file
attributes are changed to those passed in newattr, and no
value is returned in attributes. If mode is set to 0, the current
file attributes are returned in attributes. Both newattr and attri­
butes are bit flags, in which each bit corresponds to a particu­
lar attribute, as shown in Table 6-5.
You may get or set a file's time and date stamp with the
function Fdatime(), which is called as follows:
int handle, mode;
long *timeptr;
Fdatime(timeptr, handle, mode);

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents