PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Networking » Net_FTP » Bug #6754

SCO Openserver matched as WINDOWS

Details

Submitted2006-02-11 17:35 UTC
Frommonotask at sonaglia dot it
Assignedjorrit
StatusClosed
PackageNet_FTP
PHP Version5.0.5
Roadmaps1.4.0a1

Comments

[2006-02-11 17:35 UTC] monotask at sonaglia dot it

Description:
------------
The class doesn't work properly when connected via FTP to a SCO Openserver (Version wu-2.6.2(1) Tue Feb 18 02:26:24 PST 2003).
The result of the line
$dir_list = @ftp_rawlist($this->_handle, $dir);

into the function _list_and_parse($dir)

is the following:

array(18) {
[0]=>
string(9) "total 582"
[1]=>
string(55) "-r-------- 1 auth 0 Feb 11 18:23 .lastlogin"
[2]=>
string(49) "drwxrwxrwx 2 group 512 Nov 3 2003 0103"
[3]=>
string(49) "drwxrwxrwx 2 group 512 Aug 5 2004 0204"
[4]=>
string(49) "drwxrwxrwx 2 group 512 Feb 2 2005 0205"
[5]=>
string(49) "drwxrwxrwx 2 group 512 Feb 3 09:51 0206"
[6]=>
string(49) "drwxrwxrwx 2 group 512 Oct 7 2004 0303"
[7]=>
string(49) "drwxrwxrwx 2 group 512 Feb 8 12:48 0305"
[8]=>
string(49) "drwxrwxrwx 2 group 512 Nov 4 2003 0503"
[9]=>
string(49) "drwxrwxrwx 2 group 512 Jan 20 2004 0504"
[10]=>
string(49) "drwxrwxrwx 2 group 512 Jan 8 2005 0505"
[11]=>
string(49) "drwxrwxrwx 2 group 512 Jan 9 11:33 0506"
[12]=>
string(49) "drwxrwxrwx 2 group 512 Oct 31 2003 0802"
[13]=>
string(49) "drwxrwxrwx 2 group 92160 Jan 29 2004 0803"
[14]=>
string(49) "drwxrwxrwx 2 group 95744 Oct 7 2004 0804"
[15]=>
string(49) "drwxrwxrwx 2 group 93184 Jan 5 15:21 0805"
[16]=>
string(49) "drwxrwxrwx 2 group 512 Jan 2 09:01 0806"
[17]=>
string(49) "drwxrwxrwx 2 group 512 Oct 24 2003 0896"
}

It match like a windows OS. Different pattern is needed.

Test script:
---------------

[2006-02-11 19:09 UTC] monotask at sonaglia dot it

I solved my problem changing $_ls_match array in the following way:

var $_ls_match = array(
'unix' => array(
'pattern' => '/(?:(d)|.)([rwxt-]+)\s+(\w+)\s+([\w\d-]+)\s+([\w\d-]+)\s+(\w+)\s+(\S+\s+\S+\s+\S+)\s+(.+)/',
'map' => array(
'is_dir' => 1,
'rights' => 2,
'files_inside' => 3,
'user' => 4,
'group' => 5,
'size' => 6,
'date' => 7,
'name' => 8,
)
),
'OpenServer' => array(
'pattern' => '/(?:(d)|.)([rwxt-]+)\s+(\w+)\s+(\w+)\s+(\w+)\s(\w+\s+\d+\s+.+)\s+(.+)/',
'map' => array(
'is_dir' => 1,
'rights' => 2,
'user' => 3,
'group' => 4,
'size' => 5,
'date' => 6,
'name' => 7,
)
),
'windows' => array(
'pattern' => '/(.+)\s+(.+)\s+((<DIR>)|[0-9]+)\s+(.+)/',
'map' => array(
'name' => 5,
'date' => 1,
'size' => 3,
'is_dir' => 4,
)
)
);