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

Source code in the emacs programming language

(directory-files "/some/dir/name"
                 nil        ;; just the filenames, not full paths
                 "\\.c\\'"  ;; regexp
                 t)         ;; don't sort the filenames
;;=> ("foo.c" "bar.c" ...)


  

You may also check:How to resolve the algorithm Color wheel step by step in the zkl programming language
You may also check:How to resolve the algorithm 100 doors step by step in the Io programming language
You may also check:How to resolve the algorithm Nested templated data step by step in the AutoHotkey programming language
You may also check:How to resolve the algorithm Playing cards step by step in the MUMPS programming language
You may also check:How to resolve the algorithm Keyboard input/Keypress check step by step in the RPL programming language