- public int chmod (string filename, int mode)
A wrapper for the POSIX
chmod function.
- public int close (int fd)
GLib.FileUtils.close closes a file descriptor,
so that it no longer refers to any file and may be reused.
- public bool close_checked (int fd) throws FileError
This wraps the
close call.
- public int error_from_errno (int err_no)
Gets a FileError
constant based on the passed-in err_no
.
- public int fsync (int fd)
A wrapper for the POSIX `fsync()` function.
- public bool get_contents (string filename, out string contents, out size_t length = null) throws FileError
- public bool get_data (string filename, out uint8[] contents) throws FileError
Reads an entire file into allocated memory, with good error checking.
- public int mkstemp (string tmpl)
Opens a temporary file.
- public int open_tmp (string tmpl, out string name_used) throws FileError
Opens a file for writing in the preferred directory for temporary files (as
returned by get_tmp_dir).
- public string read_link (string filename) throws FileError
Reads the contents of the symbolic link filename
like the POSIX
`readlink()` function.
- public int remove (string filename)
A wrapper for the POSIX remove
function.
- public int rename (string oldfilename, string newfilename)
A wrapper for the POSIX rename
function.
- public bool set_contents (string filename, string contents, ssize_t length = -1) throws FileError
- public bool set_contents_full (string filename, string contents, ssize_t length = -1, FileSetContentsFlags flags = 0, int mode = 0666) throws FileError
Writes all of contents
to a file named filename
,
with good error checking.
- public bool set_data (string filename, uint8[] contents) throws FileError
Writes all of contents
to a file named filename
.
- public int symlink (string oldpath, string newpath)
Creates a symbolic link
- public bool test (string filename, FileTest test)
Returns true if any of the tests in the
bitfield test
are true.
- public int unlink (string filename)
A wrapper for the POSIX
unlink function.
- public int utime (string filename, UTimBuf? times = null)
A wrapper for the POSIX utime
function.