unwanted UNIX file permissions after using File::Copy::syscopy 
Author Message
 unwanted UNIX file permissions after using File::Copy::syscopy

Even though my umask is set at 664, allowing both read and write access to
owner and group, a Perl script I'm developing copies files (using
File::Copy::syscopy) which then have permissions 002 - allowing only write
by others. It then attemps to modify the copied files but can't of course
because of having invalid permissions. Does a script not inherit its owner's
umask? How do I solve this problem and get the script to use my umask?

Here's my code which creates files with incorrect permissions:

File::Copy::syscopy( "../Templates/$TEMPLATE", "$filename.html" )
# requires 'use File::Copy'
        or die "replace_template_strings: template not copied for
$filename.html: $!";

Brian



Fri, 28 Jan 2005 23:31:04 GMT  
 unwanted UNIX file permissions after using File::Copy::syscopy

: Even though my umask is set at 664, allowing both read and write access to

I think you misunderstand umask.



Sat, 29 Jan 2005 01:05:46 GMT  
 unwanted UNIX file permissions after using File::Copy::syscopy


Quote:

>Even though my umask is set at 664, allowing both read and write access to
>owner and group, a Perl script I'm developing copies files (using
>File::Copy::syscopy) which then have permissions 002 - allowing only write
>by others. It then attemps to modify the copied files but can't of course
>because of having invalid permissions. Does a script not inherit its owner's
>umask? How do I solve this problem and get the script to use my umask?

You don't set your umask to 664, but the other way around.
You set umask to 002  to get 664 permissions.  
--
Regards, Helgi Briem
helgi AT decode DOT is


Sat, 29 Jan 2005 11:58:10 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Using File::Copy and Sockets to copy public files from http addresses

2. File::Copy from NT to Unix using UNC

3. Warning using copy from File::Copy

4. Win32::Perms, copying permissions from subdirectories and files

5. File::Copy, copying files problem.

6. Retrieving UNIX file permissions

7. File copying from Mac To Unix

8. File Permissions on NT 4 using Perl 5.004

9. how to copy values from a file into a oracle-table using DBI

10. How to copy files using system( ) in a Perl script

11. Using system( ) command to copy files

12. Using perl to copy JPG files

 

 
Powered by phpBB® Forum Software