Packages
glib-2.0
GLib
FileUtils
chmod
close
error_from_errno
get_contents
get_data
mkstemp
open_tmp
read_link
remove
rename
set_contents
set_data
symlink
test
unlink
utime
Stays crunchy ...
... even in milk.
Valadoc
Vala
Tutorial
Vala Journal
API-References
Markup
About
GLib.FileUtils
Description:
Content:
Functions:
public
bool
get_contents
(
string
filename,
out
string
contents,
out
size_t
length =
null
)
throws
FileError
public
bool
set_contents
(
string
filename,
string
contents,
ssize_t
length = -
1
)
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
bool
set_data
(
string
filename,
uint8
[] contents)
throws
FileError
Writes all of
contents
to a file named
filename
, with good error checking.
public
bool
test
(
string
filename,
FileTest
test)
Returns
true
if any of the tests in the bitfield
test
are
true
.
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
error_from_errno
(
int
err_no)
Gets a
FileError
constant based on the passed-in
err_no
.
public
int
mkstemp
(
string
tmpl)
Opens a temporary file.
public
int
rename
(
string
oldfilename,
string
newfilename)
public
int
remove
(
string
filename)
public
int
unlink
(
string
filename)
A wrapper for the POSIX
unlink
function.
public
int
chmod
(
string
filename,
int
mode)
public
int
utime
(
string
filename,
UTimBuf
? times =
null
)
public
int
symlink
(
string
oldpath,
string
newpath)
Creates a symbolic link
public
int
close
(
int
fd)
close
closes a file descriptor, so that it no longer refers to any file and may be reused.