[][src]Module fungus::sys

Modules

exec
ext
libc
user

Structs

Chmod

Chmod provides flexible options for changing file permission with optional configuration.

Copyfile

Copyfile provides a flexible options for copying files

Info

Type of operating system rust is running on

Stdio

Enums

Arch

Type of operating system rust is running on

Platform

Type of operating system rust is running on

Traits

PathColorExt
PathExt

Functions

abs

Return the path in an absolute clean form

all_dirs

Returns all directories for the given path recurisely, sorted by filename. Handles path expansion. Paths are returned as abs paths. Doesn't include the path itself. Paths are guaranteed to be distinct.

all_files

Returns all files for the given path recursively, sorted by filename. Handles path expansion. Paths are returned as abs paths. Doesn't include the path itself. Paths are guaranteed to be distinct.

all_paths

Returns all paths for the given path recursively, sorted by filename. Handles path expansion. Paths are returned as abs paths. Doesn't include the path itself. Paths are guaranteed to be distinct.

arch

Detect at runtime the system architecture rust is running on.

chmod

Wraps chmod_p to apply the given mode to all files/dirs using recursion and invoking the mode change on the close of this function call.

chmod_p

Create Chmod options providing path expansion, globbing, recursion and error tracing while setting the mode. This function provides more control over options than the chmod function. Changes are not invoked until the chmod method is called. Symbolic links will have the target mode changed.

copy

Copies src to dst recursively creating destination directories as needed and handling path expansion and globbing e.g. copy("./*", "../") and returning an absolute path of the destination.

copyfile

Wraps copyfile_p to copy the given src to the given dst. Disables follow_links and uses the source mode rather than an optionally set one.

copyfile_p

Copies a single file from src to dst, creating destination directories as needed and handling path expansion and optionally following links.

cwd

Returns the current working directory. Just wraps the Rust env function but I kept forgetting where it was located.

dirs

Returns all directories for the given path, sorted by filename. Handles path expansion. Paths are returned as abs paths. Doesn't include the path itself only its children nor is this recursive.

exists

Returns true if the given path exists. Handles path expansion.

expand

Expand all environment variables in the path as well as the home directory.

extract_string

Returns the first captured string from the given regular expression rx.

extract_string_p

Returns the first captured string from the given regular expression rx.

extract_strings

Returns the captured strings from the given regular expression rx.

extract_strings_p

Returns the captured strings from the given regular expression rx.

files

Returns all files for the given path, sorted by filename. Handles path expansion. Paths are returned as abs paths. Doesn't include the path itself only its children nor is this recursive.

gid

Returns the group ID of the owner of this file. Handles path expansion.

glob

Returns a vector of all paths from the given target glob with path expansion and sorted by name. Doesn't include the target itself only its children nor is this recursive.

info

Get system information

is_dir

Returns true if the given path exists and is a directory. Handles path expansion.

is_exec

Returns true if the given path exists and is an executable. Handles path expansion

is_file

Returns true if the given path exists and is a file. Handles path expansion

is_readonly

Returns true if the given path exists and is readonly. Handles path expansion

is_symlink

Returns true if the given path exists and is a symlink. Handles path expansion

is_symlink_dir

Returns true if the given path exists and is a symlinked directory. Handles path expansion

is_symlink_file

Returns true if the given path exists and is a symlinked file. Handles path expansion

linux

True if rust is running on linux

macos

True if rust is running on macos

mash

Returns a new owned PathBuf from dir mashed together with base. Differs from the mash implementation as mash drops root prefix of the given path if it exists and also drops any trailing '/' on the new resulting path. More closely aligns with the Golang implementation of join.

metadata

Returns the Metadata object for the Path if it exists else an error. Handles path expansion.

mkdir

Creates the given directory and any parent directories needed, handling path expansion and returning an absolute path created.

mkdir_p

Wraps mkdir allowing for setting the directory's mode.

move_p

Move a file or directory handling path expansion and globbing. Replaces destination files if exist but always moves src into dst if dst is an existing directory.

parse_paths

Parse unix shell pathing e.g. $PATH, $XDG_DATA_DIRS or $XDG_CONFIG_DIRS. List of directories seperated by :

paths

Returns all directories/files for the given path, sorted by filename. Handles path expansion. Paths are returned as abs paths. Doesn't include the path itself only its children nor is this recursive.

platform

Detect at runtime the type of operating system we are running.

readbytes

Returns the contents of the path as a Vec<u8>.

readlines

Returns all lines from teh file as a Vec<String>.

readlines_p

Returns an Iterator to the Reader of the lines of the file.

readlink

Returns the absolute path for the given link target. Handles path expansion

readstring

Returns the contents of the path as a String.

remove

Removes the given empty directory or file. Handles path expansion. Does not follow symbolic links but rather removes the links themselves.

remove_all

Removes the given directory after removing all of its contents. Handles path expansion. Does not follow symbolic links but rather removes the links themselves.

revoking_mode

Returns true if the new mode is revoking permissions as compared to the old mode as pertains directory read/execute permissions. This is useful when recursively modifying file permissions.

symlink

Creates a new symbolic link. Handles path expansion and returns an absolute path to the link while still creating the symbolic link as a relative path to the target.

touch

Create an empty file similar to the linux touch command. Handles path expansion. Uses default file creation permissions 0o666 - umask usually ends up being 0o644.

touch_p

Wraps touch allowing for setting the file's mode.

uid

Returns the user ID of the owner of this file. Handles path expansion.

windows

True if rust is running on windows

write

Write [u8] data to a file which means str or String. Handles path expansion.

write_p

Wraps write allowing for setting the file's mode.

writelines

Write &Vec<String> data to a file as lines. Handles path expansion.

writelines_p

Wraps writelines allowing for setting the file's mode.

x86

Returns true if the system is a x86 system.

x86_64

Returns true if the system is a x86_64 system.