in reply to Checking "Modify" property of the file on windows
it appears that on windows to delete the file i need to be able to modify it (even if I can read and write the file i may not be able to delete it).
Correct! It can also be more complex than that.
The simplest way to get the full DACLs for a file or directory is:
$dir = 'users'; $rights = `icacls $dir`; print $rights;; users NT AUTHORITY\SYSTEM:(OI)(CI)(F) BUILTIN\Administrators:(OI)(CI)(F) BUILTIN\Users:(RX) BUILTIN\Users:(OI)(CI)(IO)(GR,GE) Everyone:(RX) Everyone:(OI)(CI)(IO)(GR,GE) Successfully processed 1 files; Failed processing 0 files
See the help for the icacls command for the explanation of the output
Its not the friendliest format for the information, but it is easily parsed for specific purposes.
Alternatively, take a look at jenda's Win32::FileSecurity. Be warned, it has limitations, lacks documentation and isn't the simplest of interfaces.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Checking "Modify" property of the file on windows
by Anonymous Monk on Jul 03, 2016 at 19:29 UTC |