#!/usr/bin/php -q php readindex.php {path to image} {position in file} * * @author Bernd Holzmueller * @license http://creativecommons.org/licenses/by-sa/3.0/de/ Creative Commons Attribution-Share Alike 3.0 Germany * @copyright Copyright © 2010 tiggersWelt.net **/ require ('loadfat.php'); if (!is_object ($Image)) die ('Something went wrong...' . "\n"); // Retrive the position to read $p = null; if (isset ($argv [2])) { if (substr ($argv [2], 0, 2) == '0x') $p = hexdec ($argv [2]); else $p = intval ($argv [2]); } // Try to read the index there $Files = $Image->readIndex ($p); if (!is_array ($Files) || (count ($Files) == 0)) exit (0); // Output contents echo 'Filename Size Created Modified' . "\n" . '---------------------------------------------------------------------------------------' . "\n"; foreach ($Files as $File) echo $File ['Filename'] . str_repeat (' ', 22 - strlen ($File ['Filename']) - strlen ($File ['Size'])) . $File ['Size'] . ' Bytes ' . date ('d.m.Y H:i:s', $File ['Created']) . ' ' . date ('d.m.Y H:i:s', $File ['Modify']) . ' starting at 0x' . dechex ($File ['Cluster']) . "\n"; ?>