How to resolve the algorithm Walk a directory/Non-recursively step by step in the Nanoquery programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Walk a directory/Non-recursively step by step in the Nanoquery programming language
Table of Contents
Problem Statement
Walk a given directory and print the names of files matching a given pattern.
(How is "pattern" defined? substring match? DOS pattern? BASH pattern? ZSH pattern? Perl regular expression?)
Note: This task is for non-recursive methods. These tasks should read a single directory, not an entire directory tree.
Note: Please be careful when running any code presented here.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Walk a directory/Non-recursively step by step in the Nanoquery programming language
Source code in the nanoquery programming language
import Nanoquery.IO
for fname in new(File).listDir("/foo/bar")
if lower(new(File, fname).getExtension()) = ".mp3"
println filename
end
end
You may also check:How to resolve the algorithm Averages/Arithmetic mean step by step in the BASIC programming language
You may also check:How to resolve the algorithm Array length step by step in the zkl programming language
You may also check:How to resolve the algorithm Operator precedence step by step in the ALGOL 60 programming language
You may also check:How to resolve the algorithm Mad Libs step by step in the Red programming language
You may also check:How to resolve the algorithm OpenGL step by step in the Ada programming language