.Cutfromtop Method

Top  Previous  Next

Function:

Removes a specified number of sectors from the beginning of a file opened "on" a currently selected file number (selection is made through fd.filenum).

Syntax:

fd.cutfromtop(numsectors as dword) as pl_fd_status_codes

Returns:

One of the following pl_fd_status_codes, also affects fd.laststatus:

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.

14- PL_FD_STATUS_TRANSACTION_CAPACITY_EXCEEDED: Too many disk sectors have been modified in the cause of the current transaction (fatal).

See Also:

Removing Data From Files,

fd.setfilesize

 


Part

Description

numsectors

Number of sectors to remove from the beginning of the file. Supplied value will be corrected downwards if exceeded the total number of sectors allocated to this file.

Details

As a result of this method invocation, the pointer will be set to 0 if the file becomes empty, or 1 if the file still has some data in it.

This method makes changes to the sectors of the flash disk. For the highest possible reliability, use disk transactions when invoking this method.