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

Source code in the euphoria programming language

include file.e

procedure show(sequence pattern)
    sequence f
    f = dir(pattern)
    for i = 1 to length(f) do
        puts(1,f[i][D_NAME])
        puts(1,'\n')
    end for
end procedure

show("*.*")

  

You may also check:How to resolve the algorithm Bitwise IO step by step in the PureBasic programming language
You may also check:How to resolve the algorithm Burrows–Wheeler transform step by step in the RPL programming language
You may also check:How to resolve the algorithm Arrays step by step in the Red programming language
You may also check:How to resolve the algorithm Dot product step by step in the Ursala programming language
You may also check:How to resolve the algorithm Zeckendorf number representation step by step in the Mathematica/Wolfram Language programming language