How to resolve the algorithm Walk a directory/Non-recursively step by step in the Frink 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 Frink 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 Frink programming language

Source code in the frink programming language

for f = select[files["."], {|f1| f1.getName[] =~ %r/\.frink$/}]
   println[f.getName[]]

  

You may also check:How to resolve the algorithm Terminal control/Hiding the cursor step by step in the Ring programming language
You may also check:How to resolve the algorithm Binary digits step by step in the 8086 Assembly programming language
You may also check:How to resolve the algorithm Gapful numbers step by step in the ALGOL 68 programming language
You may also check:How to resolve the algorithm Non-decimal radices/Output step by step in the Tcl programming language
You may also check:How to resolve the algorithm 4-rings or 4-squares puzzle step by step in the Groovy programming language