module

Filemod

Module for interacting with files and directories

Instance methods

file_getextension(filepath : Path) : String | Nil

Extracts the file extension

Source
file_linecount(filepath : Path) : Int32 | Nil

Reads file and returns number of lines

Source
read_dir(d : Path) : Array(Path) | Nil

Reads directory returning paths of all files inside directory

Source
read_dir_rec(d : Path) : Array(Path) | Nil

Reads directory recursively, returning paths of all files inside directory traversing it recursively.

Source
read_dir_rec_with_depth(d : Path, depth : Int) : Array(Path) | Nil

Reads directory recursively up to a maximum recursion depth.

Source