Walk a directory/Recursively: Difference between revisions

Content added Content deleted
Line 1,365: Line 1,365:
if file.match re".*\.mp3":
if file.match re".*\.mp3":
echo file</lang>
echo file</lang>

=={{header|Objeck}}==
<lang objeck>use System.IO.File;

class Test {
function : Main(args : String[]) ~ Nil {
if(args->Size() = 1) {
DescendDir(args[0]);
};
}

function : DescendDir(path : String) ~ Nil {
files := Directory->List(path);
each(i : files) {
file := files[i];
if(<>file->StartsWith('.')) {
dir_path := String->New(path);
dir_path += '/';
dir_path += file;
if(Directory->Exists(dir_path)) {
DescendDir(dir_path);
dir_path->PrintLine();
};
};
};
}
}</lang>


=={{header|Objective-C}}==
=={{header|Objective-C}}==