mFile.getFileAttributes()

Availability

Windows: Flash 8 or 9 AS2.0 SWF + mProjector 3.0; Windows 98/ME/NT Support: Flash 7 SWF + mProjector 2.0;

Macintosh: Flash 8 or 9 AS2.0 SWF + mProjector 3.0.5;

Usage

mFile.getFileAttributes(fileName:String) : Object

Parameters

fileName - Name (including the path) of the file for which attributes should be returned.

Returns

An object with the following properties:

Description

Method; Returns specified file's attributes.

Example

The following example traces the specified file's size and it's attributes.

var fileAttr = mFile.getFileAttributes(Files[i]);
mApplication.trace(fileAttr.Size);

if (fileAttr.Attributes == 0) {
    mApplication.trace("No Attributes Set...");
} else {
    if (fileAttr.Attributes & 1) {
      mApplication.trace("File is Read-only");
    } else {
      mApplication.trace("File is NOT Read-only");
    }

    if (fileAttr.Attributes & 2) {
      mApplication.trace("File is a hidden file");
    } else {
      mApplication.trace("File is NOT a hidden file");
    }

    if (fileAttr.Attributes & 4) {
      mApplication.trace("File is a system file");
    } else {
      mApplication.trace("File is NOT a system file");
    }

    if (fileAttr.Attributes & 8) {
      mApplication.trace("File is a disk drive volumn label");
    } else {
      mApplication.trace("File is NOT a disk drive volumn label");
    }

    if (fileAttr.Attributes & 16) {
      mApplication.trace("File is a directory");
    } else {
      mApplication.trace("File is NOT a directory");
    }

    if (fileAttr.Attributes & 32) {
      mApplication.trace("File has the Archive bit set");
    } else {
      mApplication.trace("File does NOT have the Archive bit set");
    }
}