Attributes String from File
Posted by admin - Sep 2, 2008 Articles, Dani Vainstein, Files, QTips 0 0 Views : 342 Receive Updates For This Category
Article Tools
- Print this page
- Add Comment
- Send to Friend
- Last Updated on :
Jul 16, 2011
file attributes are like switches. If the switch for Hidden is on, the file is a hidden file. If the switch for Hidden is off, the file is not a hidden file.
This analogy can be carried further by noting that light switches are typically under your control: you can choose to turn them on, or you can choose to turn them off.
In this QTip we are going to write a generic function that would retrieve a folder attributes as a string abbreviation.
File Attributes
- A file attribute is metadata that describes or is associated with a computer file.
- For example, an operating system often keeps track of date a file was created and last modified, as well as the file’s size and extension (and what application to open it with).
- File permissions are also kept track of. The user may attach other attributes themselves.
- A bitmap is like a set of switches that can be either on or off.
- If a particular switch is off, that switch has the value 0.
- If the switch is on, at least in the case of a folder object, it has one of the values shown in the attributes the value of the bitmap is equal to the sum of all the switches.
- Directory has the value 16.
- Because the other switches are off, each has the value 0.
- The total value for the bitmap is thus 16. If you queried the Attributes value for this folder, the script would return 16.
The Function
Examples


