Page 1 of 1

AttrStamp and refreshing

Posted: 07 Mar 2022 11:18
by John_C
Here is a simple script that I found yesterday that toggles the read-only attribute:

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);
  }
The script itself works fine, but there is an issue with refreshing related to it.

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
Does #1001 cover all the other ones from this list? (So if you want to refresh "everything", you only need #1001, is it correct?)

Re: AttrStamp and refreshing

Posted: 07 Mar 2022 16:23
by John_C
Confirmed by anybody?

Re: AttrStamp and refreshing

Posted: 07 Mar 2022 19:33
by admin
Just refresh the list by scripting.