note 63372 added to function.ftp-rawlist

From: Date: Tue, 21 Mar 2006 15:51:44 +0000
Subject: note 63372 added to function.ftp-rawlist
Groups: php.notes 
Request: Send a blank email to php-notes+get-106159@lists.php.net to get a copy of this message
try this <? for($i = 0; $i < count($raw_list); $i++) { $dirline = $raw_list[$i]; if($systyp == "Windows_NT") { if(ereg("[-0-9]+ *[0-9:]+[PA]?M? +<DIR> {10}(.*)",$dirline,$regs)) { $out[] = array('type' => 'directory', 'name' => $regs[1]); } elseif(ereg("[-0-9]+ *[0-9:]+[PA]?M? +([0-9]+) (.*)",$dirline,$regs)) { $out[] = array('type' => 'file', 'size' => $regs[1], 'name' => $regs[2]); } } elseif($systyp == "UNIX") { if($dirline == "" && ereg("total ([0-9]*)", $raw_list[$i+2], $jump_regs)) { $out[] = array('type' => 'directory', 'name' => substr($raw_list[$i+1],0,-1)); $i += intval($jump_regs[1]); } elseif(ereg("([-dl])[rwxst-]{9}.* ([0-9]*) [a-zA-Z]+ [0-9: ]*[0-9] (.+)",$dirline,$regs)) { if($regs[1] == "d") { $out[] = array('type' => 'directory', 'name' => $regs[3]); } elseif ($regs[1] == "-") { $out[] = array('type' => 'file', 'size' => $regs[2], 'name' => $regs[3]); } else { $out[] = array('type' => 'link', 'name' => $regs[3]); } } } } ?> ---- Server IP: 81.223.254.68 Probable Submitter: 83.29.131.143 ---- X-Spam-Status: No, hits=3.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER, HTML_MESSAGE autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.ftp-rawlist.php Edit -- http://master.php.net/note/edit/63372 Del: integrated -- http://master.php.net/note/delete/63372/integrated Del: useless -- http://master.php.net/note/delete/63372/useless Del: bad code -- http://master.php.net/note/delete/63372/bad+code Del: spam -- http://master.php.net/note/delete/63372/spam Del: non-english -- http://master.php.net/note/delete/63372/non-english Del: in docs -- http://master.php.net/note/delete/63372/in+docs Del: other reasons-- http://master.php.net/note/delete/63372 Reject -- http://master.php.net/note/reject/63372 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#106159) next »