file exists with fpwrite through ftp error

From: Date: Tue, 22 Feb 2000 23:51:16 +0000
Subject: file exists with fpwrite through ftp error
Groups: php.version4 
Request: Send a blank email to php-version4+get-10678@lists.php.net to get a copy of this message
in our project we need to write a file to a ftp server with fpwrite.. when the file does not exist, it writes it.. but when the file exists, we get a 'file exists' error message.. this is done using the php binary.. (as its needed for a cron job) uploading to a solaris ftp server works fine whether the file exists or not, but uploading to a linux server with wuftpd or proftpd gives us errors.. anyone have any ideas whats wrong? here is a snippet of what i use.. <? $ftp = "ftp://root:blah@ip.address/root/"; $cache_time = 600; $page = "http://localhost/results.php"; $time = split(" ", microtime()); srand((double)microtime()*1000000); $cache_time_rnd = 300 - rand(0, 600); $fpread = fopen($page, 'r'); $fpwrite = fopen($ftp . "resultscomplete.php", 'w'); while(!feof($fpread)) { $buffer = ltrim(chop(fgets($fpread, 256))); fputs($fpwrite, "$buffer\n"); } fclose($fpread); $date_now = date("d.m H:i"); fputs( $fpwrite, "\n aktualisiert: $date_now\n"); fclose($fpwrite); ?> and the error message i see: <br> <b>Warning</b>: File already exists in <b>./scriptpage.php</b> on line <b>10</b><br> <br> <b>Warning</b>: fopen("ftp://...@ip.address/root/resultscomplete.php",'w') - File exists in <b>./scriptpage.php</b> on line <b>10</b><br> <br> <b>Warning</b>: Supplied argument is not a valid File-Handle resource in <b>./scriptpage.php</b> on line <b>14</b><br> <br> .... this happens on any directory.. /root /tmp / .. with an ftp client, overwriting works fine to the server.. thanks for your time harald

« previous php.version4 (#10678) next »