#!/usr/bin/php "; die; } echo "Yuba ".$version."\n"; echo "-----------------------------------------------\n"; echo date("F jS, Y h:i:s", time())."\n"; $banner = "Walking ".$zpath." to ".$dbfile; echo $banner."\n"; echo str_repeat("-", strlen($banner))."\n"; die; $dir_iter = new RecursiveDirectoryIterator($zpath, RecursiveDirectoryIterator::SKIP_DOTS ); $iter = new RecursiveIteratorIterator($dir_iter, RecursiveIteratorIterator::SELF_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD ); $i = 1; foreach ($iter as $splFileInfo) { $key[$splFileInfo->getRealPath()] = $i; $i++; } $line = array(); foreach ($key as $path => $id) { echo $path."\n"; $info = pathinfo($path); $line[$id]['parent'] = @$key[$info['dirname']]; $line[$id]['path'] = $path; if (is_dir($path)) { $line[$id]['isdir'] = 1; } else { $line[$id]['isdir'] = 0; } $line[$id]['size'] = filesize($path); $hash = md5_file($path); $line[$id]['hash'] = $hash; $line[$id]['perms'] = fileperms($path); $line[$id]['owner'] = fileowner($path).":".filegroup($path); $line[$id]['type'] = filetype($path); $line[$id]['inode'] = fileinode($path); $line[$id]['mtime'] = filemtime($path); $line[$id]['atime'] = fileatime($path); $line[$id]['ctime'] = filectime($path); $spotlight = shell_exec("mdls \"".$path."\" 2>&1"); if ($spotlight != $path.": could not find ".$path.".\n") { $line[$id]['mdls'] = $spotlight; } $thumb = "/tmp/".$hash.".png"; exec("qlmanage -t -o \"".$thumb."\" \"".$path."\""); if (file_exists($thumb)) { $line[$id]['thumb'] = file_get_contents($blob); } } print_r($line); ?>