Qore Programming Language Reference Manual 1.14.0
|
Functions | |
bool | Qore::absolute_path (string path) |
returns True if the argument is an absolute path on the current platform, False if not More... | |
bool | Qore::absolute_path_unix (string path) |
returns True if the argument is a UNIX absolute path, False if not More... | |
bool | Qore::absolute_path_windows (string path) |
returns True if the argument is a Windows absolute path, False if not More... | |
int | Qore::chdir (string path) |
Changes the current working directory for the current process. More... | |
int | Qore::chmod (string path, softint mode) |
Changes the mode of a file or directory. More... | |
int | Qore::chown (string path, softint owner=-1, softint group=-1) |
Changes the user and group owners of a file, if the current user has permission to do so (normally only the superuser can change the user owner), follows symbolic links. More... | |
*string | Qore::getcwd () |
Returns a string giving the current working directory or NOTHING if the current working directory could not be read. More... | |
string | Qore::getcwd2 () |
Returns a string giving the current working directory; throws an exception if the current directory cannot be read. More... | |
*list< string > | Qore::glob (string glob_str) |
Returns a list of files matching the string argument or NOTHING if the call to glob() fails. More... | |
nothing | Qore::glob () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
*hash< StatInfo > | Qore::hlstat (string path) |
Returns a StatInfo hash for the path argument and does not follow symbolic links; if any errors occur, NOTHING is returned and errno() can be used to retrieve the error number. More... | |
nothing | Qore::hlstat () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
*hash< StatInfo > | Qore::hstat (string path) |
Returns a StatInfo hash for the path argument, following any symbolic links; if any errors occur, NOTHING is returned and errno() can be used to retrieve the error number. More... | |
nothing | Qore::hstat () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
bool | Qore::is_bdev (string path) |
Returns True if the string passed identifies a block device on the filesystem, False if not. More... | |
bool | Qore::is_cdev (string path) |
Returns True if the string passed identifies a character device on the filesystem, False if not. More... | |
bool | Qore::is_dev (string path) |
Returns True if the string passed identifies a device (either block or character) on the filesystem, False if not. More... | |
bool | Qore::is_dir (string path) |
Returns True if the string passed identifies a directory on the filesystem, False if not. More... | |
bool | Qore::is_executable (string path) |
Returns True if the string passed identifies an executable on the filesystem, False if not. More... | |
bool | Qore::is_file (string path) |
Returns True if the string passed identifies a regular file on the filesystem, False if not. More... | |
bool | Qore::is_link (string path) |
Returns True if the string passed identifies a symbolic link on the filesystem, False if not. More... | |
bool | Qore::is_pipe (string path) |
Returns True if the string passed identifies a pipe (FIFO) on the filesystem, False if not. More... | |
bool | Qore::is_readable (string path) |
Returns True if the string passed identifies a file or a directory readable by the current user, False if not. More... | |
bool | Qore::is_socket (string path) |
Returns True if the string passed identifies a socket on the filesystem, False if not. More... | |
bool | Qore::is_writable (string path) |
Returns True if the string passed identifies a file or a directory writable by the current user, False if not. More... | |
bool | Qore::is_writeable (string path) |
Returns True if the string passed identifies a file or a directory writable by the current user (backwards-compatible misspelling of is_writable()) More... | |
int | Qore::lchown (string path, softint uid=-1, softint gid=-1) |
Changes the user and group owners of a file, if the current user has permission to do so (normally only the superuser can change the user owner), does not follow symbolic links but rather operates on the symbolic link itself. More... | |
*list< auto > | Qore::lstat (string path) |
Returns a list of file status values for the path argument and does not follow symbolic links; if any errors occur, NOTHING is returned and errno() can be used to retrieve the error number. More... | |
nothing | Qore::lstat () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
int | Qore::mkdir (string path, softint mode=0777, bool parents=False) |
Creates a directory, optionally specifying the mode. More... | |
nothing | Qore::mkdir_ex (string path, softint mode=0777, bool parents=False) |
Creates a directory, optionally specifying the mode; throws an exception on error. More... | |
int | Qore::mkfifo (string path, softint mode=0600) |
Creates a named pipe file with an optional file mode. More... | |
string | Qore::readlink (string path) |
Returns the target of a symbolic link; throws an exception if an error occurs (ex: file does not exist or is not a symbolic link) More... | |
string | Qore::realpath (string path) |
Returns the canonicalized absolute pathname from the given path. More... | |
nothing | Qore::rename (string old_path, string new_path) |
Renames (or moves) files or directories. Note that for this call to function properly, the Qore process must have sufficient permissions and access to the given filesystem objects or paths to execute the rename operation. More... | |
int | Qore::rmdir (string path) |
Removes a directory. More... | |
*list< auto > | Qore::stat (string path) |
Returns a list of file status values for the path argument, following any symbolic links; if any errors occur, NOTHING is returned and errno() can be used to retrieve the error number. More... | |
nothing | Qore::stat () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
*hash< FilesystemInfo > | Qore::statvfs (string path) |
Returns a hash of filesystem status values for the file or directory path passed. More... | |
nothing | Qore::symlink (string old_path, string new_path) |
Creates a symbolic link to a directory path. Note that for this call to function properly, the Qore process must have sufficient permissions and access to the given filesystem path to create the symbolic link. More... | |
int | Qore::umask (softint mask) |
Sets the file creation mode mask for the process and returns the previous value of the file creation mode mask. More... | |
nothing | Qore::umask () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
int | Qore::unlink (string path) |
Deletes a file and returns 0 for success, -1 for error (in which case errno() can be used to get the error) More... | |
nothing | Qore::unlink () |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments. More... | |
The following functions return information about or are related to the filesystem.
All of the functions in this section (except umask()) are flagged with Qore::PO_NO_FILESYSTEM
Element | Data Type | Description |
0 | int | device inode number the file is on |
1 | int | inode of the file |
2 | int | inode protection mode |
3 | int | number of hard links to this file |
4 | int | user ID of the owner |
5 | int | group ID of the owner |
6 | int | device type number |
7 | int | file size in bytes |
8 | date | last access time of the file |
9 | date | last modified time of the file |
10 | date | last change time of the file's inode |
11 | int | block size; may be zero if the platform's internal stat() (2) function does not provide this info |
12 | int | blocks allocated for the file; may be zero if the platform's internal stat() (2) function does not provide this info |
bool Qore::absolute_path | ( | string | path | ) |
bool Qore::absolute_path_unix | ( | string | path | ) |
bool Qore::absolute_path_windows | ( | string | path | ) |
Changes the current working directory for the current process.
path | the new working directory for the current process |
Changes the mode of a file or directory.
path | the path to the file or directory to change |
mode | the new mode for the file or directory |
Changes the user and group owners of a file, if the current user has permission to do so (normally only the superuser can change the user owner), follows symbolic links.
path | path to the file or directory to change |
owner | the uid of the new user owner; -1 means do not change user owner |
group | the gid of the new group owner; -1 means do not change group owner |
*string Qore::getcwd | ( | ) |
Returns a string giving the current working directory or NOTHING if the current working directory could not be read.
string Qore::getcwd2 | ( | ) |
Returns a string giving the current working directory; throws an exception if the current directory cannot be read.
nothing Qore::glob | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Returns a list of files matching the string argument or NOTHING if the call to glob() fails.
glob_str | the glob string, containing an optional path (in which case the entire path must be readable) and a glob filename pattern |
nothing Qore::hlstat | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Returns a StatInfo hash for the path argument and does not follow symbolic links; if any errors occur, NOTHING is returned and errno() can be used to retrieve the error number.
path | the path to retrieve information for |
nothing Qore::hstat | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Returns a StatInfo hash for the path argument, following any symbolic links; if any errors occur, NOTHING is returned and errno() can be used to retrieve the error number.
path | the path to retrieve information for |
bool Qore::is_bdev | ( | string | path | ) |
Returns True if the string passed identifies a block device on the filesystem, False if not.
path | the path to check |
bool Qore::is_cdev | ( | string | path | ) |
Returns True if the string passed identifies a character device on the filesystem, False if not.
path | the path to check |
bool Qore::is_dev | ( | string | path | ) |
Returns True if the string passed identifies a device (either block or character) on the filesystem, False if not.
path | the path to check |
bool Qore::is_dir | ( | string | path | ) |
Returns True if the string passed identifies a directory on the filesystem, False if not.
path | the path to check |
bool Qore::is_executable | ( | string | path | ) |
Returns True if the string passed identifies an executable on the filesystem, False if not.
path | the path to check |
bool Qore::is_file | ( | string | path | ) |
Returns True if the string passed identifies a regular file on the filesystem, False if not.
path | the path to check |
bool Qore::is_link | ( | string | path | ) |
Returns True if the string passed identifies a symbolic link on the filesystem, False if not.
path | the path to check |
bool Qore::is_pipe | ( | string | path | ) |
Returns True if the string passed identifies a pipe (FIFO) on the filesystem, False if not.
path | the path to check |
bool Qore::is_readable | ( | string | path | ) |
Returns True if the string passed identifies a file or a directory readable by the current user, False if not.
path | the path to check |
bool Qore::is_socket | ( | string | path | ) |
Returns True if the string passed identifies a socket on the filesystem, False if not.
path | the path to check |
bool Qore::is_writable | ( | string | path | ) |
Returns True if the string passed identifies a file or a directory writable by the current user, False if not.
path | the path to check |
bool Qore::is_writeable | ( | string | path | ) |
Returns True if the string passed identifies a file or a directory writable by the current user (backwards-compatible misspelling of is_writable())
path | the path to check |
Changes the user and group owners of a file, if the current user has permission to do so (normally only the superuser can change the user owner), does not follow symbolic links but rather operates on the symbolic link itself.
path | path to the file or directory to change |
uid | the uid of the new user owner; -1 means do not change user owner |
gid | the gid of the new group owner; -1 means do not change group owner |
nothing Qore::lstat | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Returns a list of file status values for the path argument and does not follow symbolic links; if any errors occur, NOTHING is returned and errno() can be used to retrieve the error number.
path | the path to retrieve information for |
Creates a directory, optionally specifying the mode.
path | the path to the directory to create |
mode | the file mode of the new directory (which will be AND'ed with the umask) |
parents | if True then parent directories are created |
Creates a directory, optionally specifying the mode; throws an exception on error.
path | the path to the directory to create |
mode | the file mode of the new directory (which will be AND'ed with the umask) |
parents | if True then parent directories are created |
Creates a named pipe file with an optional file mode.
path | the path to the new named pipe |
mode | the file mode for the new named pipe |
Returns the target of a symbolic link; throws an exception if an error occurs (ex: file does not exist or is not a symbolic link)
path | the path to the symbolic link |
READLINK-ERROR | Invalid arguments or a system error occured (ex: file does not exist or is not a symbolic link) |
Returns the canonicalized absolute pathname from the given path.
path | the path to process |
REALPATH-ERROR | if an error occurs calculating the return value then this exception is thrown |
Renames (or moves) files or directories. Note that for this call to function properly, the Qore process must have sufficient permissions and access to the given filesystem objects or paths to execute the rename operation.
This function does not return any value; if any errors occur, an exception is thrown.
old_path | The original path for the file to move |
new_path | The target path for the file |
RENAME-ERROR | empty string passed for one of the arguments or the operating system returned an error |
Removes a directory.
path | the path to the directory to remove |
nothing Qore::stat | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Returns a list of file status values for the path argument, following any symbolic links; if any errors occur, NOTHING is returned and errno() can be used to retrieve the error number.
path | the path to retrieve information for |
*hash< FilesystemInfo > Qore::statvfs | ( | string | path | ) |
Returns a hash of filesystem status values for the file or directory path passed.
path | the path to the filesystem (or on the filesystem) |
Creates a symbolic link to a directory path. Note that for this call to function properly, the Qore process must have sufficient permissions and access to the given filesystem path to create the symbolic link.
This function does not return any value; if any errors occur, an exception is thrown. If the target of the symbolic link does not exist, it is not an error; the symbolic link is created anyway.
old_path | The original path; the target of the link |
new_path | The path to the location of the new symbolic link to be created with this function call |
SYMLINK-ERROR | empty string passed for one of the arguments or the operating system returned an error |
nothing Qore::umask | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
int Qore::umask | ( | softint | mask | ) |
Sets the file creation mode mask for the process and returns the previous value of the file creation mode mask.
mask | the new file creation mode mask for the process |
nothing Qore::unlink | ( | ) |
This function variant does nothing at all; it is only included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
Deletes a file and returns 0 for success, -1 for error (in which case errno() can be used to get the error)
Does not delete directories; see rmdir() for a similar function that removes directories
path | the path to the file to delete |