Code: Select all
// https://www.xyplorer.com/xyfc/viewtopic.php?t=6979
"Toggle Read-Only Attribute"
if (StrPos(Report('{Attr}', 1), 'r') < 0) {
AttrStamp('r', 1);
} else {
AttrStamp('r', 4);
}
1. Make sure you have Auto-Refresh enabled: Tools | Configuration | Refresh, Icons, History | Auto-Refresh = True
2. Attach the script to a user button and enable the Attr column.
3. Select some file and press the user button you have created. Notice the file is now read-only.
4. Press Delete to delete it to the Recycle Bin.
5. Press Ctrl-Z to restore it. Notice the file is still read-only.
6. Select the same file and press the user button again. Notice the file is still displayed as read-only. This is not really true, the read-only attribute was successfully removed, but you need to manually refresh the list to see this (that is, you need to press F5).
Probably a bug that is related to AttrStamp. Tested on Win7, XY 22.90.0100
Also, a side question. I see that there are many "refreshing" commands:
Code: Select all
#1001 Refresh
#482 Refresh Tree
#483 Refresh Current Folder
#485 Refresh List
#501 Caches | Refresh Thumbnails
#502 Caches | Refresh Icons
XYplorer Beta Club