Reading and Writing File Attributes
'this example ignores potential error conditions
Dim s As String
s=fd.getattributes("File1.dat") 'get the attributes for this file
If instr(1,s,"R",1)=0 Then 'delete the file only if there is no 'R' in the attributes
You can set new (change) attributes with the fd.setattributes method:
If fd.setattributes("File1.dat", "D")<>PL_FD_STATUS_OK Then 'the attribute string will now consist of a single 'D'
Remember that the file name and the attributes share the same 56-byte string in the file record table of the flash disk. Therefore, the maximum length of the attributes is limited to 56-length_of_the_file_name - 1. This "-1" accounts for the space character that separates the file name from the attributes.