bhagperl has asked for the wisdom of the Perl Monks concerning the following question:
Good Morning to all of you !
I am trying to run cgi script, which copies file from source to target location with UNIX cp command or copy function from File::Copy.
in the cgi script i have line like this:
$cp="cp-f"; $rc=system("$cp $source_file $target_file"); if(!$rc) { print "error: $! \n"; exit 2; }
Above copy command is copying to target location, but is modifying the file permissions as:
Source file permissions = -rw-r--r-- 1 httpd httpd
Target file permissions = -rw-r----- 1 httpd httpdWhy is that ?
Please help me regarding this.
Thanking you in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: copying files from cgi perl script is modifying target file permissions
by choroba (Cardinal) on Jun 20, 2012 at 06:43 UTC | |
by taint (Chaplain) on Jun 20, 2012 at 18:25 UTC | |
by afoken (Chancellor) on Jun 21, 2012 at 19:54 UTC | |
|
Re: copying files from cgi perl script is modifying target file permissions
by frozenwithjoy (Priest) on Jun 20, 2012 at 06:38 UTC | |
|
Re: copying files from cgi perl script is modifying target file permissions
by cheekuperl (Monk) on Jun 20, 2012 at 08:22 UTC | |
|
Re: copying files from cgi perl script is modifying target file permissions
by Don Coyote (Hermit) on Jun 20, 2012 at 08:32 UTC | |
|
Re: copying files from cgi perl script is modifying target file permissions
by Happy-the-monk (Canon) on Jun 20, 2012 at 07:35 UTC |