Categories

File Details

File Details using the RecursiveDirectoryIterator class

<?php
//change the $dir to a directory on your system
//This was a directory on my test Windows XP machine
$dir = new RecursiveDirectoryIterator(‘C:\test’);
$totalSize = 0;
foreach (new RecursiveIteratorIterator($dir) as $file)
{
    //$totalSize += $file->getSize();
 print “Name : $file” . “<br>”;
 print “Size : ” . $file->getSize() . ” bytes<br>”;
 print “Type : ” . $file->getType() . “<br>”;
 print “Path : ” . $file->getPath() . “<br>”;
 print “Path Name : ” . $file->getPathName() . “<br>”;
 print “<br>”;
}

?>

Related posts:

  1. Manual Installation Tutorial for PHP 5 on IIS 5.1 (Windows XP Pro) Before we begin any installation steps, the first thing we...

Related posts brought to you by Yet Another Related Posts Plugin.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>