Skylib module containing utility functions related to directories.
native.glob, but for DirectoryInfo.
PARAMETERS
Name | Description | Default Value |
---|---|---|
directory | (DirectoryInfo) The directory to look relative from. | none |
include | (List[string]) A list of globs to match. | none |
allow_empty | (bool) Whether to allow a glob to not match any files. | False |
RETURNS
depset[File] A set of files that match.
Given a directory and a chunk of a glob, returns possible candidates.
PARAMETERS
Name | Description | Default Value |
---|---|---|
directory | (DirectoryInfo) The directory to look relative from. | none |
chunk | (string) A chunk of a glob to look at. | none |
RETURNS
List[Either[DirectoryInfo, File]]] The candidate next entries for the chunk.
Calculates all files that are matched by a glob on a directory.
PARAMETERS
Name | Description | Default Value |
---|---|---|
directory | (DirectoryInfo) The directory to look relative from. | none |
glob | (string) A glob to match. | none |
RETURNS
List[File] A list of files that match.
Gets the direct child of a directory.
PARAMETERS
Name | Description | Default Value |
---|---|---|
directory | (DirectoryInfo) The directory to look within. | none |
name | (string) The name of the directory/file to look for. | none |
require_dir | (bool) If true, throws an error if the value is not a directory. | False |
require_file | (bool) If true, throws an error if the value is not a file. | False |
RETURNS
(File|DirectoryInfo) The content contained within.
Gets a subdirectory contained within a tree of another directory.
PARAMETERS
Name | Description | Default Value |
---|---|---|
directory | (DirectoryInfo) The directory to look within. | none |
path | (string) The path of the directory to look for within it. | none |
require_dir | (bool) If true, throws an error if the value is not a directory. | False |
require_file | (bool) If true, throws an error if the value is not a file. | False |
RETURNS
(File|DirectoryInfo) The directory contained within.
Returns the files and directories contained within a directory transitively.
PARAMETERS
Name | Description | Default Value |
---|---|---|
directory | (DirectoryInfo) The directory to look at | none |
RETURNS
List[Either[DirectoryInfo, File]] The entries contained within.