When copying a file or moving it to another volume, permissions are inherited from the parent folder in the new location. But when moving a file in the same volume, original permissions are preserved. This behavior makes move operations unreliable, particularly in multi-user environments. This is true for both Explorer and XYplorer, but with Explorer it's possible to reset permissions even on move operations by reseting MoveSecurityAttributes in registry.
I would appreciate a corresponding option in XYplorer. It's possible to achieve this by passing the FOF_NOCOPYSECURITYATTRIBS flag to the SHFileOperation function.
Regards,
MrSpock
Reset security attributes on move operation
-
admin
- Site Admin
- Posts: 64886
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Reset security attributes on move operation
Ah, did you know how much like wishes that come packed with the solution right away?MrSpock wrote:When copying a file or moving it to another volume, permissions are inherited from the parent folder in the new location. But when moving a file in the same volume, original permissions are preserved. This behavior makes move operations unreliable, particularly in multi-user environments. This is true for both Explorer and XYplorer, but with Explorer it's possible to reset permissions even on move operations by reseting MoveSecurityAttributes in registry.
I would appreciate a corresponding option in XYplorer. It's possible to achieve this by passing the FOF_NOCOPYSECURITYATTRIBS flag to the SHFileOperation function.
Regards,
MrSpock
FAQ | XY News RSS | XY X
-
admin
- Site Admin
- Posts: 64886
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Are you sure that only the Move operation is affected by this setting? The documentation seems to include the Copy operation as well...MrSpock wrote:I guess not all customers are software developers.
I'll be satisfied if you read that registry value, but a checkbox is probably a better choice for most users. Suggestion: "Preserve permissions on move operation" (on by default)
Thanks! I guess I have to upgrade to v7 now...
FAQ | XY News RSS | XY X
Well, security attributes are always reset when a file is created. If you copy a file or move it to a different volume, a new file is created. But if you move a file in the same volume, the file isn't physically moved. There is just a new link to the file. That's why permissions are preserved as default on move operations in the same volume.
This blog post explains the details:
http://blogs.msdn.com/oldnewthing/archi ... 17181.aspx
This blog post explains the details:
http://blogs.msdn.com/oldnewthing/archi ... 17181.aspx
-
admin
- Site Admin
- Posts: 64886
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Ah, okay. Then this should do:MrSpock wrote:Well, security attributes are always reset when a file is created. If you copy a file or move it to a different volume, a new file is created. But if you move a file in the same volume, the file isn't physically moved. There is just a new link to the file. That's why permissions are preserved as default on move operations in the same volume.
This blog post explains the details:
http://blogs.msdn.com/oldnewthing/archi ... 17181.aspx
Code: Select all
+ Configuration | Advanced: Added option "Preserve permissions on
move operation". When checked (which is the default and was up to
now the hard-coded behavior) then the security attributes of files
are preserved when they are moved in the same volume. Uncheck it to
have the moved files inherit the security attributes of their new
folder.FAQ | XY News RSS | XY X
XYplorer Beta Club