note 36700 added to function.ftp-rawlist

From: Date: Sun, 19 Oct 2003 09:05:39 +0000
Subject: note 36700 added to function.ftp-rawlist
Groups: php.notes 
Request: Send a blank email to php-notes+get-58881@lists.php.net to get a copy of this message
Another "formula" for decoding the rawlist: the ide is that normaly a "ls" contains info like below: <file rights> <number> <owner> <group> <date> <time> <filename> and: the "time" contains a ":" (which is NOT contained in any of the other infos -if we reversely read the array) and, in the case the "time" would not exist, i have done a "protection script" that would try to find out using the year... Yet that may NOT always work since a user name or group name MAY contain an item like "1999" etc... (and i did not check the date format reversely -on the filename first- since a probability of presence is higher of a date is MUCH higher in a filename) So here we go: <? [... code ...] $fnTest=array("198","199","200","201","202"); [... code ...] $j=0; $strrpos=strrpos($list[$i],":"); while($strrpos==0){ $strrpos=strpos($list[$i],$fnTest[$j]); $j++;} if($j){ $strrpos+=2+strlen($fnTest[$j]); }else{ $strrpos+=4;} $elmt=substr($list[$i],$strrpos); [... code ...] ?> and $elmt would *normally* contain the info we want... but i'm still working on it! ---- Manual Page -- http://www.php.net/manual/en/function.ftp-rawlist.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36700 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36700&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36700&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#58881) next »