Main constructor to build new Path from string
Constructor that allows to build path from segments * Params: * segments = array of segments to build path from
Append data to file as is
Returns base name of current path
Change current working directory to this.
Copy single file to destination. If destination does not exists, then file will be copied exactly to that path. If destination already exists and it is directory, then method will try to copy file inside that directory with same name. If destination already exists and it is file, then depending on rewrite param file will be owerwritten or PathException will be thrown.
Copy file or directory to destination If source is a file, then copyFileTo will be use to copy it. If source is a directory, then more complex logic will be applied: - if dest already exists and it is not dir, then exception will be raised. - if dest already exists and it is dir, then source dir will be copied inseide that dir with it's name - if dest does not exists, then current directory will be copied to dest path.
Execute the file pointed by path * * Params: * args = arguments to be passed to program * env = associative array that represent environment variables * to be passed to program pointed by path * workDir = Working directory for new process. * config = Parameters for process creation. * See See std.process.Config * maxOutput = Max bytes of output to be captured * Returns: * An std.typecons.Tuple!(int, "status", string, "output").
Execute the file pointed by path * * Params: * args = arguments to be passed to program * env = associative array that represent environment variables * to be passed to program pointed by path * workDir = Working directory for new process. * config = Parameters for process creation. * See See std.process.Config * maxOutput = Max bytes of output to be captured * Returns: * An std.typecons.Tuple!(int, "status", string, "output").
Check if path exists
Expand tilde (~) in current path.
Returns extension for current path
Get attributes of the path
Return size of file specified by path
Check if file has numeric attributes. This method check if all bits specified by param 'attributes' are set.
Check if path is absolute
Determine if path is directory.
Determine if path is file.
Check if path is null
Check if path starts at root directory (or drive letter)
Determine if path is symlink
Check if path is valid.
Join multiple path segments and return single path.
Create directory by this path
Normalize path.
Open file and return std.stdio.File struct with opened file
determine parent path of this path
Read entire contents of file name and returns it as an untyped array. If the file size is larger than upTo, only upTo bytes are _read.
Read text content of the file. Technicall just a call to std.file.readText.
Resolve link and return real path. Available only for posix systems. If path is not symlink, then return it unchanged
Return this path as relative to base
Remove file or directory referenced by this path. This operation is recursive, so if path references to a direcotry, then directory itself and all content inside referenced dir will be removed
Rename current path.
Search file by name in current directory and parent directories. * Usually, this could be used to find project config, * when current directory is somewhere inside project. * * If no file with specified name found, then return null path. * * Params: * file_name = Name of file to search * Returns: * Path to searched file, if such file was found. * Otherwise return null Path.
Set attributes of the path * * Params: * attributes = value representing attributes to set on path.
Create symlink for this file in dest path.
Convert path to absolute path.
Return path as string
Iterate over all files and directories inside path;
Write data to file as is
Return current path (as absolute path)
Main struct to work with paths.