Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 exploiting the Monastery: (9)
As of 2014-10-22 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (122 votes), past polls