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:
- File list of a folder <?php //folder to check $folder = “C:/xampp/htdocs/xampp/wordpress/wp-includes”; $handle = opendir($folder);...
- FTP file upload example upload a single file to a FTP server // FTP...
- Delete files that are over 7 days old <?php $dir = ‘/path/to/dir’; if ($handle = opendir($dir)) { ...
- Manual Installation Tutorial for PHP 5 on IIS 5.1 (Windows XP Pro) Before we begin any installation steps, the first thing we...
- create a gzip file this example backs up the index.php as a gzip file...
Related posts brought to you by Yet Another Related Posts Plugin.



















