AttrStamp and refreshing

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
John_C
Posts: 336
Joined: 16 May 2018 20:04

AttrStamp and refreshing

Post 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?)

John_C
Posts: 336
Joined: 16 May 2018 20:04

Re: AttrStamp and refreshing

Post by John_C »

Confirmed by anybody?

admin
Site Admin
Posts: 66631
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: AttrStamp and refreshing

Post by admin »

Just refresh the list by scripting.

Post Reply