SPUG: finding the permissions

ced at carios2.ca.boeing.com ced at carios2.ca.boeing.com
Fri Feb 1 17:02:02 CST 2002


> I am trying to find the permission on a file.  
> For some reason 'File::Copy' does not keep the same permission 
> on the file that I am trying to copy.  So I would like to get 
> the permission of the file so I can set the file permission.

> Maybe I missed something with File::Copy.

Here's a hint from the docs (perldoc -f stat) : 

 $mode = (stat($filename))[2];
 printf "Permissions are %04o\n", $mode & 07777;

You can reset the umask if that's the culprit in 
permissions transfer problem (perldoc -f umask).

rgds,
--
Charles DeRykus

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org





More information about the spug-list mailing list