.Create Method


Creates a new file with the specified name and attributes.


fd.create(byref name_attr as string) as pl_fd_status_codes


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).

4- PL_FD_STATUS_INV_PARAM: Invalid argument have been provided.

5- PL_FD_STATUS_DUPLICATE_NAME: File with this name already exists.

6- PL_FD_STATUS_FILE_TABLE_FULL: Maximum number of files that can be stored on the disk has been reached, new file cannot be created.

7- PL_FD_STATUS_DATA_FULL: The disk is full, new data cannot be added.

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:

Creating, Deleting, and Renaming Files, File Names and Attributes,

fd.rename, fd.delete, fd.getnumfiles, fd.maxstoredfiles




A string (1-56 characters),  must contain a file name and, optionally, attributes separated from the file name by a space. File names are case-sensitive.


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