attrstamp()
Sets the attributes for files or folders.
Syntax
attrstamp([attr], [mode=1], [itemlist])
attr: a = FILE_ATTRIBUTE_ARCHIVE (32)
h = FILE_ATTRIBUTE_HIDDEN (2)
r = FILE_ATTRIBUTE_READONLY (1)
s = FILE_ATTRIBUTE_SYSTEM (4)
They can be combined in any order and any case, e.g. "raH".
mode: 0=get, 1=set [Default], 2=replace, 3=toggle, 4=remove.
itemlist: |-separated list of items (full path) to attrstamp;
if empty then the currently selected list items are attrstamped.
return: Old attributes of the last processed item. The return value is made from summing up the attributes bit values, e.g. RAH = 1 + 32 + 2 = 35.
Examples
attrstamp("r"); //set readonly to selected items
attrstamp("rh"); //set readonly and hidden to selected items
attrstamp("r", 2); //set readonly to selected items (any other existing attributes are removed)
attrstamp("r", 3); //toggle readonly in selected items
attrstamp("R", 3); //toggle readonly in selected items (same as above)
attrstamp("r", 4); //remove readonly from selected items
attrstamp("r", , "E:\Test\x"); //set readonly to "E:\Test\x"
If no attributes are passed it just returns the old attributes of the last processed item:
text attrstamp(); //e.g. 5 = 1+4 (readonly and system)
attrstamp("r", 0, <curitem>) returns the same as attrstamp("h", 0, <curitem>) as attrstamp("s", 0, <curitem>) as attrstamp("a", 0, <curitem>)
This is not logical and therefore must be a bug.
"r" should only return the value for "r", "h" for "h", "s" for "s" and "a" for "a". If I want the whole sum of the values then it should be attrstamp(, 0, <curitem>).
Besides what about the attributes N = NORMAL, D = DIRECTORY, O = OFFLINE, C = COMPRESSED and T = TEMPORARY?