SPUG: Re: finding the permissions

Richard Anderson richard at richard-anderson.org
Fri Feb 1 21:05:19 CST 2002


What you are seeing is expected behavior.  On Unix and most other operating
systems every process (running program) has a set of permissions associated
with it that are assigned to any new file the process creates.  (Copying a
file means you are creating a new file with the same contents as the source
file.)  As Charles points out, you can control this set of permissions by
resetting the process umask before creating any new files.

If you are on a Unix system you can play with this feature from the command
line:

umask
touch newfile
ls -l newfile
umask 072
touch newfile2
ls -l newfile*
umask 022   # or whatever the first umask command showed

Cheers,
Richard
richard at richard-anderson.org
www.richard-anderson.org
www.raycosoft.com
----- Original Message -----
From: "Douglas Kirkland" <douglas at slugstone.net>
To: "Seattle Perl Users Group" <spug-list at pm.org>
Sent: Friday, February 01, 2002 2:39 PM
Subject: SPUG: finding the permissions


> 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.
>
> Douglas
>
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>      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
>
>
>


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     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