Thank you!

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 03, 2003 11:28 AM
To: Copits Richard; [EMAIL PROTECTED]
Subject: RE: How do I retrieve permissions?



------------------------------------------------
On Fri, 3 Jan 2003 11:12:43 -0500, <[EMAIL PROTECTED]> wrote:

> 
> I am writing a program that uses the CHMOD function to set permissions

> on a file. I'd like to then be able to "read" or "retrieve" the 
> permission value for that file and compare it against what I wanted to

> set it to to know if it actually did get changed. I searched the 
> fuctions that are built into PERL but didn't find anything that seemed

> to fit. Can anyone suggest how I can retrieve the permissions on a 
> file? I've tried a GOOGLE search on "perl" and "module" and 
> "permissions" but nothing seemed to fit. Thank you.
> 

To answer your question you want to have a look at the 'stat' function.
perldoc -f stat, specifically the mode entry.

As an aside, you should be able to use an 'or' construct with your chmod
command to see if it worked, i.e.:

chmod 0755, $file or die "Couldn't change permissions on file: $!";

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to