Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-23-2005, 05:02 PM   #1
Registered: Jul 2003
Location: NSW. Australia
Distribution: Ubuntu, Fedora, Slackware
Posts: 181

Rep: Reputation: 30
perl file::copy RESETs permissions.

Hi All,

I have an annoying and strange problem.

I am trying to copy a file using perl, from one directory to another. The script taht does this is called from my webserver, when a user clicks a button.

Now, the target directory has the correct permissions (755), the source file has the correct permissions (755) but when I copy the file, the permissions on the file are being reset to -rw-r--r--, ie I have no execute permissions on the new file.

The file is being copied correctly, but the permissions are being reset! Argh!

copy("gallery.cgi", "$galleryName/gallery.cgi");
chmod $FMODE, '$galleryName/gallery.cgi';
where $FMODE is 0755, and I am uisng the File:Copy; function.

Any ideas???


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help regarding setting Perl and file permissions... mrbadi Programming 1 07-30-2005 04:43 PM
Need help regarding setting Perl and file permissions... mrbadi Linux - Software 1 07-26-2005 01:03 PM
Permissions resets Wolf_Assassin Linux - Security 4 10-22-2004 02:31 AM
Copy User Permissions mairul Linux - Newbie 0 02-16-2004 02:09 AM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:31 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration