word FileTruncate(
FileHandle fh, /* handle of open file */
dword offset, /* offset at which to truncate */
Boolean noErrorFlag);
This routine truncates the specified file at the passed offset. The
offset
parameter can also be thought of as the desired file size. If the high bit of
noErrorFlag
is one, then no errors will be returned.
Include: file.h
word FileUnlockRecord( /* returns error */
FileHandle fh, /* handle of open file
dword filePos, /* Release lock that starts here */
dword regLength); /* and is this long */
This routine releases a lock on a part of a byte-file. The lock must have been previously placed with
FileLockRecord()
.
See Also: FileLockRecord(),
HandleV().
Include: file.h
word FileWrite( /* sets thread's error value */
FileHandle fh, /* handle of open file */
const void * buf, /* Copy from here into file */
word count, /* # of bytes to copy */
Boolean noErrorFlag); /* Set if can't handle errors */
This routine copies a specified number of bytes from a buffer to the file. The bytes are written starting with the current position in the file; any data already at that location will be overwritten.
FileWrite()
returns the number of bytes written. If
FileWrite()
could not write all the data (e.g. if the disk ran out of space), it will set the thread's error value (accessible via
ThreadGetError()
) to ERROR_SHORT_READ_WRITE and return the number of bytes that were written. If it could not write the data to the file at all (e.g. if you do not have write-access to the file), it will return -1 and set the thread's error value to ERROR_ACCESS_DENIED. In any event, the file position will be changed to the first byte after the ones written.
If the argument
noErrorFlag
is set to
true
(i.e. non-zero),
FileWrite()
will fatal-error if an error occurs.
Warnings: Pass
noErrorFlag
true
only during debugging.
Include: file.h
Boolean FloatAsciiToFloat( /* returns FALSE on success */
word floatAtoFflags,
word stringLength,
void *string,
void *resultLocation);
This routine is used to convert an ASCII string to a floating point number. It takes the following arguments:
FloatAsciiToFloatFlags
field determines what will be done with the generated floating point number. At most one flag may be set. If FAF_PUSH_RESULT is set, then the number will be pushed on the floating-point stack. If the FAF_STORE_NUMBER flag is set, the number will be returned at the resultLocation address.
GEOS SDK TechDocs
|
|
FileSetHandleExtAttributes() ...
|
FloatFloatToAscii() ...