note 66978 added to function.ftp-rawlist
| From: | paxa at nm dot ru | Date: | Thu, 01 Jun 2006 21:16:52 +0000 |
| Subject: | note 66978 added to function.ftp-rawlist | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-112828@lists.php.net to get a copy of this message | ||
i had some problems but i writen ftp scanner
i think smbd will use it
<?php
function list_dir2($ftp_conn, $put){
global $dir_list;
ftp_chdir($ftp_conn, $put); \\if use ftp_rawlist(..,$put ) will problems whis spaces
$buff = ftp_rawlist($ftp_conn, ".");
foreach ($buff as $file){
if(substr($file,0,5)!="total"){
ereg("([-dl][rwxstST-]+).* ?([0-9 ]* )?([a-zA-Z0-9]+).* ([a-zA-Z0-9]+).* ([0-9]*)
([a-zA-Z]+[0-9: ]*[0-9])[ ]+(([0-9]{2}:[0-9]{2})|[0-9]{4}) (.+)", $file, $regs) ;
if(substr($regs[1],0,1)=="d") $isdir=1; else $isdir=0;
$tmp_array['isdir']=$isdir;
$tmp_array['size']=$regs[5];
if(strlen($regs[6]) >8){
\\i had problem this files and folsers fo example "1994 bleach"
$tmp_array['name']=$regs[7].' '.$regs[9];
}else{
$tmp_array['name']=$regs[9];
}
if(substr($tmp_array['name'],0,1)!="." &&
substr($tmp_array['name'],0,2)!=".."){
if($tmp_array['isdir']==1 ){
list_dir2($ftp_conn,$tmp_array['name']);
}else{
$dir_list[]=$tmp_array['name'];
}}}}
ftp_chdir($ftp_conn, "..");
}
print_r($dir_list);
?>
----
Server IP: 195.222.164.18
Probable Submitter: 85.158.51.209
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.ftp-rawlist.php
Edit -- http://master.php.net/note/edit/66978
Del: integrated -- http://master.php.net/note/delete/66978/integrated
Del: useless -- http://master.php.net/note/delete/66978/useless
Del: bad code -- http://master.php.net/note/delete/66978/bad+code
Del: spam -- http://master.php.net/note/delete/66978/spam
Del: non-english -- http://master.php.net/note/delete/66978/non-english
Del: in docs -- http://master.php.net/note/delete/66978/in+docs
Del: other reasons-- http://master.php.net/note/delete/66978
Reject -- http://master.php.net/note/reject/66978
Search -- http://master.php.net/manage/user-notes.php