develooper Front page | perl.beginners | Postings from April 2002

RE: get file permissions?

Thread Previous | Thread Next
From:
Mark Richmond
Date:
April 2, 2002 06:48
Subject:
RE: get file permissions?
Message ID:
41B9D8A6CE9E0A4583291742EECF3CCB6B0705@mail.wirelessworld.airvananet.com

Consider sysopen(); saves you the stat(); 

Use exiting file create if required 

sysopen(FH, $path, O_WRONLY | O_TRUNC | O_CREAT);

If you're really sure it exists 

sysopen(FH, $path, O_WRONLY | O_TRUNC);


> -----Original Message-----
> From: Bryan R Harris [mailto:Bryan_R_Harris@RAYTHEON.COM]
> Sent: Monday, April 01, 2002 1:26 PM
> To: Beginners
> Subject: get file permissions?
> 
> 
> 
> Is it possible to do the reverse of a chmod?  To get the 
> permissions of a
> given file as a number?
> 
> I'm creating a new file from an old one, and I'd like the new 
> one to have
> the same permissions as the old one.  Is this possible?
> 
> TIA.
> 
> - B
> 
> 
> 
> -- 
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> 
> 

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About