Created
April 11, 2016 15:51
-
-
Save YuriyNasretdinov/2f6d12dae627b0b27cee4c8af7f97def to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function doFind($dir) { | |
$dh = opendir($dir); | |
if (!$dh) die("Could not open $dir\n"); | |
while (false !== ($f = readdir($dh))) { | |
if ($f === '.' || $f === '..') continue; | |
$path = $dir . '/' . $f; | |
echo $path . "\n"; | |
if (is_dir($path) && !is_link($path)) { | |
doFind($path); | |
} | |
} | |
closedir($dh); | |
} | |
ob_start(); | |
doFind($argv[1]); | |
ob_end_flush(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment