James Keeline wrote:
> --- Wade Smart <[EMAIL PROTECTED]> wrote:
> 
>> Warning: rename(file_name_B,3file_name_B) [function.rename]: No such 
>> file or directory in 
>> /var/www/public/Misc/Rewrite_File_Name/rewrite_file_name_01.php on line 46
>>
>> Wade
> 
> It looks as if your PHP script is not naming the correct path to reach the
> file.  Have you placed the script in the directory with the files?
> 
> James
> 
> 

01172008 1846 GMT-6

The directory I have the script in is  Rewrite_File_Name
and the files are in Rewrite_File_Name/Files.

I added $dirName which is $dirName="/Files" to the code.

foreach($file_count as $newfile){
        while($count >0){
                rename($dirName.$newfile, $dirName.$count."_".$newfile);        
        
                $count--;
        }
}

Now I get this result:


How many files? : 3
file_name_B
file_name_C
file_name_A

Warning: rename(Files/file_name_B,Files/2_file_name_B) 
[function.rename]: No such file or directory in 
/var/www/public/Misc/Rewrite_File_Name/rewrite_file_name_01.php on line 46

Warning: rename(Files/file_name_B,Files/1_file_name_B) 
[function.rename]: No such file or directory in 
/var/www/public/Misc/Rewrite_File_Name/rewrite_file_name_01.php on line 46

So its doing the first one but not the other two.

Wade

Reply via email to