A customer reported that when my app creates directories on their NAS, an error is shown. With their cooperation I boiled the source of the error down to setting URLResourceKey.fileSecurityKey
on the directory URL
, or setting any of FileAttributeKey.groupOwnerAccountID
, .groupOwnerAccountName
, .ownerAccountID
or .ownerAccountName
with FileManager
.
I thought that maybe URLResourceKey.volumeSupportsExtendedSecurityKey
would allow me to determine in advance if setting any of these attributes works, but it seems that the result is false
on one of my exFAT drives which doesn't yield any error when setting any of the attributes. I don't even know what "extended security" means in this case, and it doesn't seem to be documented. Should I rely on URLResourceKey.volumeSupportsExtendedSecurityKey
?
I tried running chown -vv myusername:admin
on a file on that exFAT drive: even if the output includes the text 501:20 -> 501:80
, which I assume means that the group should have been changed to admin
, running the command again yields the exact same output and running stat
shows that the group is still staff
.