481
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
Details
As a result of this method invocation, the pointer (see
) will be
advanced forward by the number of bytes written to the file. If the pointer wasn't
at the end of the file (at
+1 position) then (some of) the existing file
data will be partially overwritten. If the pointer moves past the current file size (
), then the file size will be increased automatically. New data sectors
will be allocated and added to the file as needed and provided that there are still
free sectors available. 7- PL_FD_STATUS_DATA_FULL status code is returned if the
disk runs out of space, in which case the entire data string supplied in the fd.
setdata is not added to the file (and not just the part that couldn't fit).
All other error codes returned by this method are "generic" and are not described
here.
.Setfilesize Method
Function:
Sets (reduces) the file size of a file opened "on" a
currently selected file number (selection is made through
the
).
Syntax:
fd.setfilesize(newsize as dword) as
pl_fd_status_codes
Returns:
One of the following
, also affects
:
0- PL_FD_STATUS_OK: Completed successfully.
1- PL_FD_STATUS_FAIL : Physical flash memory failure
(fatal).
2- PL_FD_STATUS_CHECKSUM_ERR: Checksum error has
been detected in one of the disk sectors (fatal).
3- PL_FD_STATUS_FORMAT_ERR: Disk formatting error
has been detected (fatal).
8- PL_FD_STATUS_NOT_READY: The disk is not mounted.
See Also:
Par
t
Description
ne
wsi
ze
Desired new file size in bytes. Supplied value will be corrected if
exceeded previous file size.
Details
This method cannot be used to increase the size of the file, only decrease it. Data
sectors previously allocated to this file will be "released" (marked unused) if they
become unnecessary due to the reduction in the file size. The first data sector of
the file, however, will always remain allocated, even when the file size is set to 0.
) will be corrected downwards to reflect the
amount of data left in the file.
) will be affected by this method. If the file
476
464
464
463
472
472
445
461
464
476