amalthea.fs

Undocumented in source.

Public Imports

std.typecons
public import std.typecons;
Undocumented in source.
amalthea.libcore
public import amalthea.libcore;
Undocumented in source.

Members

Aliases

cd
alias cd = std.file.chdir
Undocumented in source.
mv
alias mv = std.file.rename
Undocumented in source.
pwd
alias pwd = getcwd
Undocumented in source.
rm
alias rm = std.file.remove
Undocumented in source.

Classes

DesktopEntry
class DesktopEntry

Special set of functions for work with ini-like .desktop files.

xattr
class xattr

Function set for working with file extended attributes.

Enums

FileAdvice
enum FileAdvice

Access patterns for file data.

FileType
enum FileType

Enumeration of UNIX file types.

Functions

applyFileAdvise
void applyFileAdvise(File f, FileAdvice advice)

Predeclare an access pattern for file data.

cp
void cp(string from, string to, Flag!"followLinks" followLinks, Flag!"passErrors" passErrors, Flag!"printErrors" printErrors)

Function for copying files and directories.

exists
bool exists(string filepath)

Checks if the given file exists.

getAbsolutePath
string getAbsolutePath(string path)

Returns absolute path for any raw path. Trailing slashes are removed.

getDirectories
FileEntry[] getDirectories(string dir, Flag!"hidden" hidden, Flag!"recursively" recursively, Flag!"absPath" saveAbsolutePath)

Gets directories from the directory.

getFileTypeFromFileMask
FileType getFileTypeFromFileMask(uint mask)

Gets FileType by the file mask obtained from stat field 'mode'.

getFileTypeFromFileMode
FileType getFileTypeFromFileMode(uint mode)

Gets FileType by stat field 'mode'.

getFiles
FileEntry[] getFiles(string dir, Flag!"hidden" hidden, Flag!"recursively" recursively, Flag!"absPath" saveAbsolutePath, Flag!"enableFilter" enableFilter, FileType[] includedTypes)

Reads entries of the directory.

getRegularFiles
FileEntry[] getRegularFiles(string dir, Flag!"hidden" hidden, Flag!"recursively" recursively, Flag!"absPath" saveAbsolutePath)

Gets regular files from the directory.

getStat
stat_t getStat(string filepath)

High-level function for getting stat_t from file path.

getStatX
statx_t getStatX(string filepath)

Returns file information as statx_t. Wrapper for low level statx call.

getSymlinks
FileEntry[] getSymlinks(string dir, Flag!"hidden" hidden, Flag!"recursively" recursively, Flag!"absPath" saveAbsolutePath)

Gets symlinks from the directory.

hardlink
void hardlink(string original, string link)

Creates a new hard link (make a new name for a file, see man 2 link).

isBlockDevice
bool isBlockDevice(string path)

Checks if a path is a block device.

isBrokenSymlink
bool isBrokenSymlink(string link, Flag!"recurse" recurse)

Checks if a file is a broken symbolic link is broken (whether indicates a non-existent location).

isCharDevice
bool isCharDevice(string path)

Checks if a path is a character device.

isDir
bool isDir(string path)

Checks if a path is a directory.

isDir
bool isDir(FileEntry entry)

Checks if a FileEntry object related to a directory.

isDir
bool isDir(FileEntry entry)
Undocumented in source. Be warned that the author may not have intended to support it.
isEmptyDir
bool isEmptyDir(string dirPath)

Checks if the path is an empty directory.

isPipe
bool isPipe(string path)

Checks if a path is a pipe file (FIFO).

isRegularFile
bool isRegularFile(string path)

Checks if a path is a regular file.

isRegularFile
bool isRegularFile(FileEntry entry)

Checks if a FileEntry object related to a regular file.

isRegularFile
bool isRegularFile(FileEntry entry)
Undocumented in source. Be warned that the author may not have intended to support it.
isSocket
bool isSocket(string path)

Checks if a path is a socket.

isSymlink
bool isSymlink(string path)

Checks if a path is a symbolic link.

isSymlinkToDir
bool isSymlinkToDir(string path)

Checks if the file is a symbolic link to a directory. The check is recursive (if the link points to a link).

makeUnixFileModeLine
string makeUnixFileModeLine(uint mode)
string makeUnixFileModeLine(FileStat st)

The function returns file permissions in a string form (like -rwxrwxrwx)

makeUnixFileModeLine
string makeUnixFileModeLine(FileStat st)
Undocumented in source. Be warned that the author may not have intended to support it.
readLinkRecurse
string readLinkRecurse(string link)

Returns read symlink path. If the symlink points to other symlink, the function returns path of the last symlink of the link chain.

safeMkdir
void safeMkdir(string path)

Create a directory only if it doesn't exist.

statx
int statx(int dfd, char* filename, int flags, uint mask, statx_t* stx)

This function returns information about a file, storing it in the buffer pointed to by statxbuf. System call of Linux 4.11+, see more: man statx This function is used in the high-level FileStat structure type.

truncate
void truncate(string filepath, size_t size)

Truncate a file to a specified length.

Manifest constants

STATX_ATIME
enum STATX_ATIME;
Undocumented in source.
STATX_BASIC_STATS
enum STATX_BASIC_STATS;
Undocumented in source.
STATX_BLOCKS
enum STATX_BLOCKS;
Undocumented in source.
STATX_BTIME
enum STATX_BTIME;
Undocumented in source.
STATX_CTIME
enum STATX_CTIME;
Undocumented in source.
STATX_DEFAULT
enum STATX_DEFAULT;

Mask for stat field by default.

STATX_GID
enum STATX_GID;
Undocumented in source.
STATX_INO
enum STATX_INO;
Undocumented in source.
STATX_MNT_ID
enum STATX_MNT_ID;
Undocumented in source.
STATX_MODE
enum STATX_MODE;
Undocumented in source.
STATX_MTIME
enum STATX_MTIME;
Undocumented in source.
STATX_NLINK
enum STATX_NLINK;
Undocumented in source.
STATX_SIZE
enum STATX_SIZE;
Undocumented in source.
STATX_TYPE
enum STATX_TYPE;

See: man statx

STATX_UID
enum STATX_UID;
Undocumented in source.

Structs

DirReader
struct DirReader

Implementation of file list reader. Can be used in foreach as input range, the generator returns FileEntry.

FileEntry
struct FileEntry

Special type for files as entries in directories. Analogue of the 'dirent' structure type.

FileStat
struct FileStat

A structure for storing and retrieving file information on Linux.

statx_t
struct statx_t

A low-level structure to filling with the 'statx' system call.

Variables

eloopLimit
size_t eloopLimit;
Undocumented in source.

Meta