Bug #2773 Updated: overwriting file with ftp problem

From: Date: Sun, 16 Jun 2002 13:00:38 +0000
Subject: Bug #2773 Updated: overwriting file with ftp problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-10718@lists.php.net to get a copy of this message
ID: 2773 Updated by: sander@php.net Reported By: tdouglas@home.com -Status: Analyzed +Status: Bogus Bug Type: Misbehaving function Operating System: linux PHP Version: 3.0.12 New Comment: Thank you for taking the time to report a problem with PHP. Unfortunately, PHP 3 is no longer supported. Please download the latest version of PHP 4 from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. Previous Comments: ------------------------------------------------------------------------ [2000-07-25 12:55:07] hholzgra@php.net regarding mode "w": ftp fopen wrapper does not allow overwriting existing files even if the ftp server would give you permission to do so regarding mode "a": i'm not even sure FTP protocol supports this ... ??? ------------------------------------------------------------------------ [2000-03-02 13:01:21] joey@cvs.php.net So is this a PHP3 or PHP4 bug? It was created as 3.0.12, but you seem to be saying that it is in version 4? If you are seeing this in 4, plz update to either a newer beta, or a snapshot. (http://snaps.php.net) ------------------------------------------------------------------------ [1999-11-19 23:20:52] tdouglas@home.com <?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"; ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=2773&edit=1

« previous php.bugs (#10718) next »