Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: system( 'mv ...' ) not working?

by bm (Hermit)
on Sep 23, 2003 at 16:05 UTC ( #293552=note: print w/ replies, xml ) Need Help??


in reply to system( 'mv ...' ) not working?

Perhaps the user that runs the CGI, ie probably nobody, does not have permission to overwrite an existing /tmp/trashed. Check to see if the file already exists from the command line, and if so remove it.

Alternatively, try this:

use File::Copy; ... move($newname, '/tmp/trashed') or die "Failed to move file: $!\n";
Lastly, perhaps a better question is why can't you just unlink $newname??
--
bm


Comment on Re: system( 'mv ...' ) not working?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://293552]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (16)
As of 2015-07-02 22:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (45 votes), past polls