#27982 [Asn->Csd]: Unhelpful error message when trying to overwrite a file using ftp
ID: 27982
Updated by: pollita@php.net
Reported By: adam at trachtenberg dot com
-Status: Assigned
+Status: Closed
Bug Type: FTP related
Operating System: *
PHP Version: 5CVS-2004-04-13 (dev)
Assigned To: pollita
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2004-04-13 15:49:45] sniper@php.net
Assigned to the maintainer. :)
------------------------------------------------------------------------
[2004-04-13 15:20:37] adam at trachtenberg dot com
Description:
------------
Trying to overwrite a file using ftp without enabling
the "overwrite" context directive doesn't provide a
helpful error message.
Line 460 of ext/standard/ftp_fopen_wrapper.c does:
errno = EEXIST;
goto errexit;
However, this error number doesn't get translated into
something accessible. (That I can tell. Am I missing
something?)
This patch adds a short error message, but I'm not sure
if this is fixing a symptom instead of a root cause.
http://www.trachtenberg.com/patches/
ftp_overwrite_warning.txt
Reproduce code:
---------------
fopen('ftp://localhost/path/to/existing/file.txt',
'w');
or
file_put_contents('ftp://localhost/path/to/existing/file.txt',
'blah');
Expected result:
----------------
A useful warning message, like:
PHP Warning: fopen(ftp://...@localhost/path/to/
existing/file.txt): failed to open stream: Cannot
overwrite file in current mode
FTP server reports 213 17
Actual result:
--------------
General stream failure message, with no description:
PHP Warning: fopen(ftp://...@localhost/path/to/
existing/file.txt): failed to open stream: FTP server
reports 213 17
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27982&edit=1
Thread (3 messages)