ID:               27982
 Updated by:       [EMAIL PROTECTED]
 Reported By:      adam at trachtenberg dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         FTP related
 Operating System: *
 PHP Version:      5CVS-2004-04-13 (dev)
-Assigned To:      
+Assigned To:      pollita
 New Comment:

Assigned to the maintainer. :)




Previous Comments:
------------------------------------------------------------------------

[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://[EMAIL PROTECTED]/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://[EMAIL PROTECTED]/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

Reply via email to