ID: 14861
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: FTP related
Operating System: Linux and W2K
Old PHP Version: 4.0.6
PHP Version: 4.1.1
New Comment:

Hello?


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

[2002-01-05 07:05:07] [EMAIL PROTECTED]

Hello,

I tried to use PHP4.1.1, but there was the same Problem. Then I tried 
again to resolve the problem by my self, and it works! But I don't 
know if it is OK in connection with other FTP-server and want to use
my Script with several FTP-server on several plattforms.  I made the
following modifaktion in file ftp.c.

Line 1226:
        if (*ptr == '\n' )
Line 1254:
        if (ch == '\n' ) {


Can you use this for the standard? So that I can use the next Version?

Thanhs, Bernd


------------------------------------------------------------------------

[2002-01-04 18:56:14] [EMAIL PROTECTED]

Please test 4.1.1 and see if the problem still exists.

------------------------------------------------------------------------

[2002-01-04 17:40:11] [EMAIL PROTECTED]

Hello,

I tried to user ftp_nlist to get an directory-listing of an Suse7.1 
ftp-Server, but the function returns nothing.

I tried the same code to connect to an ftp-server on an
Windows-System.

To analyse the problem I made some printentries in the file ftp.c. I
edited 
the file in the array of line 1195. I think that here is one problem: 
the code expect "\r" and "\n", but only retrieves "\n".

Here is the code:


        while ((ch = getc(tmpfp)) != EOF) {
                printf("%d ",ch);
/*
                if (ch == '\n' && lastch == '\r') {
*/
                if (ch == '\n' ) {
                        *(text - 1) = 0;
                        printf("\nText:%s\n\n", text);
                        *++entry = text;
                }
                else {
                        *text++ = ch;
                }
                lastch = ch;
        }
        *entry = NULL;

        if (ferror(tmpfp))
                goto bail;

        fclose(tmpfp);

        if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) {
                free(ret);
                return NULL;
        }
        printf("ret[0]:%s\n", ret[0]);
        printf("ret[1]:%s\n\n", ret[1]);
        return ret;


And here is the output from my PHP-Script:

X-Powered-By: PHP/4.0.6
Content-type: text/html

45 114 119 45 114 45 45 114 45 45 32 32 49 32 114 111 111 116 32 32 32
114 111 111 116 32 32 32 49 54 51 57 32 68 101 99 32 50 49 32 50 51 58
51 48 32 105 99 97 112 46 112 104 112 10 
Text:icap.php
-rw-r-----  1 bernd  users  1717 Dec 21 23:29 kal.php


45 114 119 45 114 45 45 45 45 45 32 32 49 32 98 101 114 110 100 32 32
117 115 101 114 115 32 32 49 55 49 55 32 68 101 99 32 50 49 32 50 51 58
50 57 32 107 97 108 46 112 104 112 10 
Text:9 kal.php


ret[0]::¶
ret[1]:-rw-r-----  1 bernd  users  1717 Dec 21 23:29 kal.ph

array(2) {
  [0]=>
  string(4) ":¶"
  [1]=>
  string(52) "-rw-r-----  1 bernd  users  1717 Dec 21 23:29 kal.ph"
}


Thanks
Bernd

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=14861&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to