From: Narendra B on
TCL language: how to access ACLs?

How to access Access control list of a file via TCL? e.g. if a
particular file has permission for two users, I want to access these
two users names. So, need to ACLs.

If this is not possible via TCL, which command I can use on windows to
get the ACLs? (e.g. on Linux one can use getacl command)

Thanks,
Narendra
From: Alexandre Ferrieux on
On May 29, 9:53 am, Narendra B <bhagw...(a)gmail.com> wrote:
> TCL language: how to access ACLs?
>
> How to access Access control list of a file via TCL? e.g. if a
> particular file has permission for two users, I want to access these
> two users names. So, need to ACLs.
>
> If this is not possible via TCL, which command I can use on windows to
> get the ACLs? (e.g. on Linux one can use getacl command)
>
> Thanks,
> Narendra

Maybe look at the TWAPI extension. Dunno whether it exposes the exact
API you are after, but if anybody does, it will ;-)

Alternatively, you can use [exec] to spawn an instance of a command-
line ACL tool like cacls:

http://en.wikipedia.org/wiki/Cacls

-Alex
From: APN on
On May 29, 12:53 pm, Narendra B <bhagw...(a)gmail.com> wrote:
> TCL language: how to access ACLs?
>
> How to access Access control list of a file via TCL? e.g. if a
> particular file has permission for two users, I want to access these
> two users names. So, need to ACLs.
>
> If this is not possible via TCL, which command I can use on windows to
> get the ACLs? (e.g. on Linux one can use getacl command)
>
> Thanks,
> Narendra

Example to get this for C:\windows

package require twapi

set sd [twapi::get_resource_security_descriptor file "c:/windows"] ;#
Security descriptor
twapi::get_security_descriptor_text $sd -resourcetype file; # Print
security descriptor
twapi::get_security_descriptor_dacl $sd; # Get the DACL in the
security descriptor

See the twapi documentation for more

/Ashok