How to resolve the algorithm Walk a directory/Non-recursively step by step in the Odin 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 Odin 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 Odin programming language
Source code in the odin programming language
package main
import "core:fmt"
import "core:path/filepath"
main :: proc() {
matches, _err := filepath.glob("*.odin")
for match in matches do fmt.println(match)
}
You may also check:How to resolve the algorithm String prepend step by step in the NetRexx programming language
You may also check:How to resolve the algorithm Apply a callback to an array step by step in the Sather programming language
You may also check:How to resolve the algorithm Modular inverse step by step in the FunL programming language
You may also check:How to resolve the algorithm Nested function step by step in the Nanoquery programming language
You may also check:How to resolve the algorithm Enforced immutability step by step in the Python programming language