Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Can't rename

by b10m (Vicar)
on Mar 18, 2004 at 10:10 UTC ( #337650=note: print w/replies, xml ) Need Help??


in reply to Can't rename

In case you have no clue why something doesn't work, just add debug print statements everywhere, so you can see what is the problem.

My guesses are: file1.htm is not in $ENV{DOCUMENT_ROOT}, or your webdaemon user (apache, www, nobody...) doesn't have sufficient rights to write to $ENV{DOCUMENT_ROOT}

Besides that, you can also skip the chdir() command and try it with the use of full path names in the rename() command. Something like:

$a = "$ENV{DOCUMENT_ROOT}/file1.htm"; $b = "$ENV{DOCUMENT_ROOT}/file2.htm"; rename($a, $b) || die "Uh oh, can't rename: $!";
--
b10m

All code is usually tested, but rarely trusted.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2021-04-13 11:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?