Parent directory file descriptor
File name
Cancellable
Read all extended attributes from fd
in a canonical sorted order, and
set out_xattrs
with the result.
If the filesystem does not support extended attributes, out_xattrs
will have 0 elements, and this function will return successfully.
a file descriptor
Cancellable
For each attribute in xattrs,
set its value on the file or
directory referred to by fd
. This function does not remove any
attributes not in xattrs
.
File descriptor
Extended attributes
Cancellable
Merely wraps UNIX chmod().
Path to file
UNIX mode
a #GCancellable
Merely wraps UNIX chown().
Path to file
UNIX owner
UNIX group
a #GCancellable
Like g_file_create(), except this function allows specifying the access mode. This allows atomically creating private files.
Path to non-existent file
Unix access permissions
a #GCancellable
Like g_file_make_directory(), except does not throw an error if the directory already exists.
Path to create as directory
Also create parent directories
a #GCancellable
Wraps UNIX mkdir() function with support for cancellable,
and
uses error
instead of errno.
Path to create as directory
Create directory with these permissions
a #GCancellable
This is a version of g_file_enumerator_next_file() that's easier to use correctly from C programs. With g_file_enumerator_next_file(), the gboolean return value signifies "end of iteration or error", which requires allocation of a temporary #GError.
In contrast, with this function, a %FALSE return from
gs_file_enumerator_iterate() out_info
being %NULL.
Another crucial difference is that the references for out_info
and
out_child
are owned by direnum
(they are cached as hidden
properties). You must not unref them in your own code. This makes
memory management significantly easier for C code in combination
with loops.
Finally, this function optionally allows retrieving a #GFile as well.
The code pattern for correctly using gs_file_enumerator_iterate() from C is:
|[ direnum = g_file_enumerate_children (file, ...); while (TRUE) { GFileInfo *info; if (!gs_file_enumerator_iterate (direnum, &info, NULL, cancellable, error)) goto out; if (!info) break; ... do stuff with "info"; do not unref it! ... }
out:
g_object_unref (direnum); // Note: frees the last info
@param direnum an open #GFileEnumerator
@param cancellable a #GCancellable
Read all extended attributes of f
in a canonical sorted order, and
set out_xattrs
with the result.
If the filesystem does not support extended attributes, out_xattrs
will have 0 elements, and this function will return successfully.
a #GFile
Cancellable
Merely wraps UNIX lchown().
Path to file
UNIX owner
UNIX group
a #GCancellable
First tries to use the UNIX link() call, but if the files are on separate devices, fall back to copying via g_file_copy().
The given flags
have different semantics than those documented
when hardlinking is used. Specifically, both
#G_FILE_COPY_TARGET_DEFAULT_PERMS and #G_FILE_COPY_BACKUP are not
supported. #G_FILE_COPY_NOFOLLOW_SYMLINKS treated as if it was
always given - if you want to follow symbolic links, you will need
to resolve them manually.
Beware - do not use this function if src
may be modified, and it's
undesirable for the changes to also be reflected in dest
. The
best use of this function is in the case where src
and dest
are
read-only, or where src
is a temporary file, and you want to put
it in the final place.
Source file
Destination file
flags
This function is similar to gs_file_linkcopy(), except it also uses
gs_file_sync_data() to ensure that dest
is in stable storage
before it is moved into place.
Source file
Destination file
flags
Like g_file_load_contents(), except validates the contents are UTF-8.
Path to file whose contents must be UTF-8
Return a #GBytes which references a readonly view of the contents of
file
. This function uses #GMappedFile internally.
a #GFile
On success, sets out_fd
to a file descriptor for the directory
that can be used with UNIX functions such as openat().
Directory name
Cancellable
On success, sets out_fd
to a file descriptor for the directory
that can be used with UNIX functions such as openat().
Parent directory file descriptor
Directory name
Cancellable
Like g_file_open_tmp(), except the file will be created in the
provided tmpdir,
and allows specification of the Unix mode,
which
means private files may be created. Return values will be stored
in out_file,
and optionally out_stream
.
Directory to place temporary file
Default mode (will be affected by umask)
Like g_file_open_tmp(), except the file will be created in the
provided tmpdir,
and allows specification of the Unix mode,
which
means private files may be created. Return values will be stored
in out_name,
and optionally out_stream
.
Directory to place temporary file
Default mode (will be affected by umask)
Wrapper for openat() using %O_RDONLY with %O_NOATIME if available.
File descriptor for directory
Pathname, relative to dfd
Cancellable
Like g_file_read(), but try to avoid updating the file's access time. This should be used by background scanning components such as search indexers, antivirus programs, etc.
a #GFile
a #GCancellable
Wraps the UNIX fsync() function (or fdatasync(), if available), which
ensures that the data in file
is on non-volatile storage.
a #GFile
Like g_file_delete(), except this function does not follow Unix symbolic links, and will delete a symbolic link even if it's pointing to a nonexistent file. In other words, this function merely wraps the raw Unix function unlink().
Path to file
a #GCancellable
Generate a name suitable for use as a temporary file. This function does no I/O; it is not guaranteed that a file with that name does not exist.
String prepended to the result
String suffixed to the result
Log structured data in an operating-system specific fashion. The
parameter opts
should be an array of UTF-8 KEY=VALUE strings.
This function does not support binary data. See
http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html
for more information about fields that can be used on a systemd
system.
Text message to send
Optional structured data
Like gs_log_structured(), but also print to standard output (if it is not already connected to the system log).
A message to log
Optional structured data
Use openat() to open a directory, using a standard set of flags.
File descriptor for origin directory
Pathname, relative to dfd
Whether or not to follow symbolic links
Use openat() to open a directory, using a standard set of flags. This function sets errno.
File descriptor for origin directory
Pathname, relative to dfd
Whether or not to follow symbolic links
Recursively copy path src
(which must be a directory) to the
target dest
. If possible, hardlinks are used; if a hardlink is
not possible, a regular copy is created. Any existing files are
overwritten.
Recursively delete the filename referenced by path;
it may be a
file or directory. No error is thrown if path
does not exist.
A file or directory
Recursively delete the filename referenced by the combination of
the directory fddfd
and path;
it may be a file or directory. No
error is thrown if path
does not exist.
A directory file descriptor, or -1 for current
Path
Cancellable
Use this function when you want your code to behave differently depeneding on whether your program was started as a systemd unit, or e.g. interactively at a terminal.
Load all extended attributes for the file named
name
residing in directorydfd
.