Bug #2773: overwriting file with ftp problem

From: Date: Fri, 19 Nov 1999 22:20:53 +0000
Subject: Bug #2773: overwriting file with ftp problem
Groups: php.dev 
Request: Send a blank email to php-dev+get-12794@lists.php.net to get a copy of this message
From: tdouglas@home.com Operating system: linux PHP version: 3.0.12 PHP Bug Type: Compile Warning Bug description: overwriting file with ftp problem <?php $fname = "ftp://user:passwd@myipaddress/../../../../www/htdocs/chemistry/"; $fname .= $name; $fname .= "_post.html"; $file = fopen($fname, "a"); // ERROR HERE /* The problem seems to be that when I run this I will get a warning that the file alread exists and it fails to open the file. In the docs it says that it will append the file if it already exists and NOT return a bad file pointer. This also fails if the mode is 'w'. However, it does work if the file doesn't exist. But it won't overwrite a file. I didn't see any documentation that mentions that this will happen if this turns out not to be a bug... I have php4 but I know someone else that got the same problem with a php3 version. */ if (!$file) { echo "<BR>Error opening file."; exit; } fputs($file,"<BR>" . "$comment" . "<HR>"); fclose($file); echo "$fname" . " has added a comment from " . "$name" . " which says, " . "$comment"; ?>

« previous php.dev (#12794) next »