file_attributes

You can use this function to check the attributes of a given file. You can add up the following constants to see the type of files you want:

ConstantDescription
fa_readonlyRead-only files
fa_hiddenHidden files
fa_sysfileSystem files
fa_volumeidVolume-id files
fa_directoryDirectories
fa_archiveArchived files

NOTE: This is a Windows only function.

 

Syntax:

file_attributes(fname, attr);

ArgumentTypeDescription
fnameStringThe name of the file to check.
attrFile Attribute ConstantThe attributes to check for.

 

Returns:

Boolean

 

Example:

if (!file_attributes(file, fa_hidden))
{
    file_delete(file);
}

This would check a file to see if it is hidden or not, and if not it is deleted.