###############
$old = "news.dat";
$new = ".newsold.dat";
rename($old, $new) or system("mv", $old, $new);
###############
But above code only works if the file news.dat is in the same directory
as the script with the above code
My Question is:
How can the above code rename a file that is in a different dir then cgi-bin script itself ..
how do i tell script the file is in different folder ...
The reason i ask this is because i am afraid if i include the path to $old like:
$old = "/home/public_html/news.dat";
i am afraid it will rename the complete dir to $new?
The path to $old is: $old = "/home/public_html/news.dat";
i have no idea how to tell the script that the file is in diff dir ...
Please advise .. thanks