LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 01-23-2005, 06:02 PM   #1
ludeKing
Member
 
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!

Code:
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???
 
  


Reply


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 05:43 PM
Need help regarding setting Perl and file permissions... mrbadi Linux - Software 1 07-26-2005 02:03 PM
Permissions resets Wolf_Assassin Linux - Security 4 10-22-2004 03:31 AM
Copy User Permissions mairul Linux - Newbie 0 02-16-2004 03:09 AM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 09:09 PM


All times are GMT -5. The time now is 05:16 AM.

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