note 21983 deleted from function.ftp-rawlist by cmb
| From: | cmb@php.net | Date: | Sun, 04 Aug 2019 08:41:20 +0000 |
| Subject: | note 21983 deleted from function.ftp-rawlist by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211782@lists.php.net to get a copy of this message | ||
Note Submitter: murasame at danzers dot org
----
I tweaked the regexp above and used it like this in a for-loop:
...
ereg("([-d])([rwxst-]{9}).* ([0-9]*) ([a-zA-Z]+[0-9: ]* [0-9]{2}:?[0-9]{2}) (.+)",
$raw[$i], $regs)
$out[] = array("is_dir" =>
($regs[1] == "d") ? true : false,
"mod" => $regs[2],
"size" => $regs[3],
"time" => $regs[4],
"name" => $regs[5],
"raw" => $regs[0]);
...
the previous version couldn't handle old dates which are in format 'M d Y' instead of
'M d H:i' correctly