Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by bm (Hermit)
on Sep 23, 2003 at 16:05 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-24 03:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found