VicBalta has asked for the wisdom of the Perl Monks concerning the following question:

I have program that looks up files. I want to get the permissions on the file. I tried using file::stat but it doesn't return what I need. What I want to find out is the permissions on the files. i.e.) which users have permission to this file/ directories. If any one has any information on this it would be greatly appreciated.

Replies are listed 'Best First'.
Re: file permission
by lshatzer (Friar) on Jul 26, 2001 at 23:58 UTC
Re: file permission
by bikeNomad (Priest) on Jul 27, 2001 at 04:14 UTC
    You don't say what operating system you're using. Since permissions are handled in very OS-specific ways, this makes it hard to help.

    If you're using Windows NT, the regular Unix file permission bits aren't terribly useful. NT has a more elaborate and fine-grained permission system than the standard Unix one. For NT, you should look at Win32::FileSecurity in libwin32. Likewise, there are different modules for Solaris, DCE, and other ACL schemes.

      Hi, sorry about that, i am on a windows 2000 os. thanks for the help
Re: file permission
by RayRay459 (Pilgrim) on Jul 27, 2001 at 20:08 UTC
    if you're using NT you can use cacls to see extended security on the file or directory. "cacls" is not a perl funtion, but i think it comes with the resource kit. i'm still new to perl but i think you might be able to do something like system("cacls FileName /extention") or something of the sort. Like i said, i am just a newbie still, but i would try something like that first :). Happy Hunting. ~Ray~