DiskHandle FileGetDiskHandle( /* sets thread's error value */
FileHandle fh);
This routine returns the handle of the disk containing an open file. If unsuccessful, it sets the thread's error value (accessible via
ThreadGetError()
).
Include: file.h
word FileGetHandleExtAttributes(
FileHandle fh, /* open file's handle */
FileExtendedAttribute attr, /* attribute to get */
void * buffer, /* attribute is written here */
word bufSize); /* length of buffer in bytes */
This routine gets one or more extended attributes of an open file. (To get the attributes of a file without opening it, call
FileGetPathExtAttributes()
.) If a single attribute is requested, the attribute will be written in the buffer passed. If several attributes are requested,
attr
should be set to FEA_MULTIPLE, and
buffer
should point to an array of
FileExtAttrDesc
structures. In this case,
bufSize
should be the number of structures in the buffer, not the length of the buffer.
If
FileGetHandleExtAttributes()
is successful, it returns zero. Otherwise, it returns one of the following error codes:
Tips and Tricks: Note that the only way to recover a custom attribute is by passing FEA_MULTIPLE, and using a
FileExtAttrDesc
to describe the attribute.
See Also: FileGetPathExtAttributes().
Include: file.h
word FileGetPathExtAttributes(
const char * path, /* path relative to current
* working directory */
FileExtendedAttribute attr, /* attribute to get */
void * buffer, /* attribute is written here */
word bufSize); /* length of buffer in bytes */
This routine gets one or more extended attributes of a GEOS file. If a single attribute is requested, the attribute will be written in the buffer passed. If several attributes are requested,
attr
should be set to FEA_MULTIPLE, and
buffer
should point to an array of
FileExtAttrDesc
structures. In this case,
bufSize
should be the number of structures in the buffer, not the length of the buffer.
If
FileGetPathExtAttributes()
is successful, it returns zero. Otherwise, it returns one of the following error codes:
Tips and Tricks: Note that the only way to recover a custom attribute is by passing FEA_MULTIPLE, and using a
FileExtAttrDesc
to describe the attribute.
See Also: FileGetHandleExtAttributes().
Include: file.h
word FileLockRecord( /* returns error */
FileHandle fh,
dword filePos, /* lock starting at this position... */
dword regLength); /* lock this many bytes */
This routine puts a lock on a part of a byte file. It first checks to make sure that there are no locks that overlap the region specified; if there are, it will fail and return ERROR_ALREADY_LOCKED. If there are no locks, it will place a lock on the region specified and return zero.
Warnings: Locking a region only prevents threads from locking part of the same region; it does not prevent them from reading from or writing to the region. If applications use this mechanism, they have to make sure to call
FileLockRecord
before trying to access a part of a file.
See Also: FileUnlockRecord(),
HandleP().
word FileMove( /* Returns error */
const char * source, /* source path and file name */
const char * dest, /* destination path and file name */
DiskHandle sourceDisk, /* These handles may be Standard */
DiskHandle destDisk); /* Path constants, or null to indi-
* cate current working directory */
This routine moves a file from one location to another. The source and destination are specified with path strings. Each string specifies a path relative to the location specified by the corresponding disk handle. If the handle is a disk handle, the path is relative to that disk's root. If the disk handle is a standard path constant, the path string is relative to that standard path. If the disk handle is null, the path is relative to the current working directory.
If
FileMove()
is successful, it returns zero. Otherwise, it returns one of the following error codes and sets the thread's error value.
See Also: FileCopy().
Include: file.h
GEOS SDK TechDocs
|
|
FileEnumLocateAttr() ...
|
FileOpen() ...