.setattributes Method

Function:

Sets the attributes string for a file with the specified file name.

Syntax:

fd.setattributes(byref name as string, byref attr as string) 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.

9 — PL_FD_STATUS_NOT_FOUND: File not found.

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

See Also:

Reading and Writing File Attributes, Creating, Deleting, and Renaming Files, File Names and Attributes, fd.getattributes, fd.create


Part

Description

name

A string (1-56 characters) with the file name. All characters after the first space encountered (excluding leading spaces) will be ignored. File names are case-sensitive.

attr

A string with attributes to be set. Attributes length cannot exceed 56-length_of_the_file_name-1. This "-1" accounts for the space character that separates the file name from the attributes.


Details

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


.setattributes Method

Details