Forum Moderators: coopster

Message Too Old, No Replies

Moving and renaming an XML File

Finally got it parsed now I have to put it away after I am done with it.

         

Drunk N Japan

4:28 pm on Jul 31, 2007 (gmt 0)

10+ Year Member



I am receiving xml files via ftp on a nightly basis. I have finally finished most of the scripts required to read these files(Some of you helped with this) into the mysql database. I am now working on a script that will look for the file, if it is there run the parsing script, and then move it to the appropriate folder with the date added to the name.
This is where the problem is coming in. I have tried in lines 13 and 14
chmod($old_file, 0777);
rename($old_file, $new_file);

and all I get is
Warning: chmod() [function.chmod]: Operation not permitted in script.php on line 13

Warning: rename($old_file,$new_file) [function.rename]: No such file or directory in script.php on line 14

I have also tried the ftp_rename from the php manual. [us3.php.net ]

I received similar messages from that also. I have also tried using $_SERVER['DOCUMENT_ROOT']. in front of my $new_file and $old_file

I know the file exists because the other part of the script is running and I use

if (file_exists($old_file)) {
to check the file. I appreciate any and all help.

Drunk

Habtom

4:59 am on Aug 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It absolutely means a path problem for me. You need to check the path of the file.

Drunk N Japan

3:32 pm on Aug 6, 2007 (gmt 0)

10+ Year Member



I have worked with the file path and now I am getting the following error.

chmod Operation not permitted in (path to program).php on line 13.

rename Permission denied in (path to program).php on line 14.

how can I change these permissions?