| Previous | Next | |
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;
mFile.getFileAttributes(fileName:String) : ObjectfileName - Name (including the path) of the file for which attributes should be returned.
An object with the following properties:
Attributes A collection of flags stored as a bit mapped 32-bit quantity which describes various aspects of the file. The original MS-DOS file attributes had only 8 bits in the file attributes, the Win32 file attributes are stored as a 32-bit quantity. Although the exact bit positions of the file attributes are not officially guaranteed to remain the same by Microsoft, they will probably never be changed.
Normal 0 No attributes set.
Read-Only 1 Read-only file. (Attribute is read/write.)
Hidden 2 File is a hidden file. (Attribute is read/write.)
System 4 A system file. (Attribute is read/write.)
Volume 8 Disk drive volume label. (Attribute is read-only.)
Directory 16 The file is a directory. (Attribute is read-only.)
Archive 32 File needs to be archived (i.e., it has changed since the last backup). (Attribute is read/write.)
Created Modified Size Method; Returns specified file's attributes.
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");
}
}| Questions or Feedback? | Previous | Next |