Skip to content

Instantly share code, notes, and snippets.

@YuriyNasretdinov
Created April 11, 2016 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YuriyNasretdinov/2f6d12dae627b0b27cee4c8af7f97def to your computer and use it in GitHub Desktop.
Save YuriyNasretdinov/2f6d12dae627b0b27cee4c8af7f97def to your computer and use it in GitHub Desktop.
<?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