Interface
GioFile
Description [src]
interface Gio.File : GObject.Object
GFile
is a high level abstraction for manipulating files on a
virtual file system. GFile
s are lightweight, immutable objects
that do no I/O upon creation. It is necessary to understand that
GFile
objects do not represent files, merely an identifier for a
file. All file content I/O is implemented as streaming operations
(see GInputStream
and GOutputStream
).
To construct a GFile
, you can use:
g_file_new_for_path()
if you have a path.g_file_new_for_uri()
if you have a URI.g_file_new_for_commandline_arg()
org_file_new_for_commandline_arg_and_cwd()
for a command line argument.g_file_new_tmp()
to create a temporary file from a template.g_file_new_tmp_async()
to asynchronously create a temporary file.g_file_new_tmp_dir_async()
to asynchronously create a temporary directory.g_file_parse_name()
from a UTF-8 string gotten fromg_file_get_parse_name()
.g_file_new_build_filename()
org_file_new_build_filenamev()
to create a file from path elements.
One way to think of a GFile
is as an abstraction of a pathname. For
normal files the system pathname is what is stored internally, but as
GFile
s are extensible it could also be something else that corresponds
to a pathname in a userspace implementation of a filesystem.
GFile
s make up hierarchies of directories and files that correspond to
the files on a filesystem. You can move through the file system with
GFile
using g_file_get_parent()
to get an identifier for the
parent directory, g_file_get_child()
to get a child within a
directory, and g_file_resolve_relative_path()
to resolve a relative
path between two GFile
s. There can be multiple hierarchies, so you may not
end up at the same root if you repeatedly call g_file_get_parent()
on two different files.
All GFile
s have a basename (get with g_file_get_basename()
). These
names are byte strings that are used to identify the file on the filesystem
(relative to its parent directory) and there is no guarantees that they
have any particular charset encoding or even make any sense at all. If
you want to use filenames in a user interface you should use the display
name that you can get by requesting the
G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
attribute with
g_file_query_info()
. This is guaranteed to be in UTF-8 and can be
used in a user interface. But always store the real basename or the GFile
to use to actually access the file, because there is no way to go from a
display name to the actual name.
Using GFile
as an identifier has the same weaknesses as using a path
in that there may be multiple aliases for the same file. For instance,
hard or soft links may cause two different GFile
s to refer to the same
file. Other possible causes for aliases are: case insensitive filesystems,
short and long names on FAT/NTFS, or bind mounts in Linux. If you want to
check if two GFile
s point to the same file you can query for the
G_FILE_ATTRIBUTE_ID_FILE
attribute. Note that GFile
does some trivial
canonicalization of pathnames passed in, so that trivial differences in
the path string used at creation (duplicated slashes, slash at end of
path, .
or ..
path segments, etc) does not create different GFile
s.
Many GFile
operations have both synchronous and asynchronous versions
to suit your application. Asynchronous versions of synchronous functions
simply have _async()
appended to their function names. The asynchronous
I/O functions call a GAsyncReadyCallback
which is then used to
finalize the operation, producing a GAsyncResult
which is then
passed to the function’s matching _finish()
operation.
It is highly recommended to use asynchronous calls when running within a shared main loop, such as in the main thread of an application. This avoids I/O operations blocking other sources on the main loop from being dispatched. Synchronous I/O operations should be performed from worker threads. See the introduction to asynchronous programming section for more.
Some GFile
operations almost always take a noticeable amount of time, and
so do not have synchronous analogs. Notable cases include:
g_file_mount_mountable()
to mount a mountable file.g_file_unmount_mountable_with_operation()
to unmount a mountable file.g_file_eject_mountable_with_operation()
to eject a mountable file.
Entity Tags
One notable feature of GFile
s are entity tags, or ‘etags’ for
short. Entity tags are somewhat like a more abstract version of the
traditional mtime, and can be used to quickly determine if the file
has been modified from the version on the file system. See the
HTTP 1.1
specification
for HTTP ETag
headers, which are a very similar concept.
Prerequisite
In order to implement File, your type must inherit fromGObject
.
Functions
g_file_new_build_filename
Constructs a GFile
from a series of elements using the correct
separator for filenames.
since: 2.56
g_file_new_build_filenamev
Constructs a GFile
from a vector of elements using the correct
separator for filenames.
since: 2.78
g_file_new_for_commandline_arg
Creates a GFile
with the given argument from the command line.
The value of arg
can be either a URI, an absolute path or a
relative path resolved relative to the current working directory.
This operation never fails, but the returned object might not
support any I/O operation if arg
points to a malformed path.
g_file_new_for_commandline_arg_and_cwd
Creates a GFile
with the given argument from the command line.
since: 2.36
g_file_new_for_path
Constructs a GFile
for a given path. This operation never
fails, but the returned object might not support any I/O
operation if path
is malformed.
g_file_new_for_uri
Constructs a GFile
for a given URI. This operation never
fails, but the returned object might not support any I/O
operation if uri
is malformed or if the uri type is
not supported.
g_file_new_tmp
Opens a file in the preferred directory for temporary files (as
returned by g_get_tmp_dir()) and returns a GFile
and
GFileIOStream
pointing to it.
since: 2.32
g_file_new_tmp_async
Asynchronously opens a file in the preferred directory for temporary files (as returned by g_get_tmp_dir()) as g_file_new_tmp().
since: 2.74
g_file_new_tmp_dir_async
Asynchronously creates a directory in the preferred directory for temporary files (as returned by g_get_tmp_dir()) as g_dir_make_tmp().
since: 2.74
g_file_new_tmp_dir_finish
Finishes a temporary directory creation started by g_file_new_tmp_dir_async().
since: 2.74
g_file_new_tmp_finish
Finishes a temporary file creation started by g_file_new_tmp_async().
since: 2.74
g_file_parse_name
Constructs a GFile
with the given parse_name
(i.e. something
given by g_file_get_parse_name()). This operation never fails,
but the returned object might not support any I/O operation if
the parse_name
cannot be parsed.
Instance methods
g_file_append_to
Gets an output stream for appending data to the file. If the file doesn’t already exist it is created.
g_file_append_to_finish
Finishes an asynchronous file append operation started with g_file_append_to_async().
g_file_build_attribute_list_for_copy
Prepares the file attribute query string for copying to file
.
since: 2.68
g_file_copy
Copies the file source
to the location specified by destination
.
Can not handle recursive copies of directories.
g_file_copy_async
Copies the file source
to the location specified by destination
asynchronously. For details of the behaviour, see g_file_copy().
g_file_copy_async_with_closures
Version of g_file_copy_async()
using closures instead of callbacks for
easier binding in other languages.
since: 2.82
g_file_create
Creates a new file and returns an output stream for writing to it. The file must not already exist.
g_file_create_async
Asynchronously creates a new file and returns an output stream for writing to it. The file must not already exist.
g_file_create_finish
Finishes an asynchronous file create operation started with g_file_create_async().
g_file_create_readwrite
Creates a new file and returns a stream for reading and writing to it. The file must not already exist.
since: 2.22
g_file_create_readwrite_async
Asynchronously creates a new file and returns a stream for reading and writing to it. The file must not already exist.
since: 2.22
g_file_create_readwrite_finish
Finishes an asynchronous file create operation started with g_file_create_readwrite_async().
since: 2.22
g_file_delete
Deletes a file. If the file
is a directory, it will only be
deleted if it is empty. This has the same semantics as g_unlink().
g_file_delete_async
Asynchronously delete a file. If the file
is a directory, it will
only be deleted if it is empty. This has the same semantics as g_unlink().
since: 2.34
g_file_dup
Duplicates a GFile
handle. This operation does not duplicate
the actual file or directory represented by the GFile
; see
g_file_copy()
if attempting to copy a file.
g_file_eject_mountable
Starts an asynchronous eject on a mountable.
When this operation has completed, callback
will be called with
user_user
data, and the operation can be finalized with g_file_eject_mountable_finish().
deprecated: 2.22
g_file_eject_mountable_finish
Finishes an asynchronous eject operation started by g_file_eject_mountable().
deprecated: 2.22
g_file_eject_mountable_with_operation
Starts an asynchronous eject on a mountable.
When this operation has completed, callback
will be called with
user_user
data, and the operation can be finalized with g_file_eject_mountable_with_operation_finish().
since: 2.22
g_file_eject_mountable_with_operation_finish
Finishes an asynchronous eject operation started by g_file_eject_mountable_with_operation().
since: 2.22
g_file_enumerate_children
Gets the requested information about the files in a directory.
The result is a GFileEnumerator
object that will give out
GFileInfo
objects for all the files in the directory.
g_file_enumerate_children_async
Asynchronously gets the requested information about the files
in a directory. The result is a GFileEnumerator
object that will
give out GFileInfo
objects for all the files in the directory.
g_file_enumerate_children_finish
Finishes an async enumerate children operation. See g_file_enumerate_children_async().
g_file_find_enclosing_mount_finish
Finishes an asynchronous find mount request. See g_file_find_enclosing_mount_async().
g_file_get_child_for_display_name
Gets the child of file
for a given display_name
(i.e. a UTF-8
version of the name). If this function fails, it returns NULL
and error
will be set. This is very useful when constructing a
GFile
for a new file and the user entered the filename in the
user interface, for instance when you select a directory and
type a filename in the file selector.
g_file_get_parent
Gets the parent directory for the file
.
If the file
represents the root directory of the
file system, then NULL
will be returned.
g_file_get_parse_name
Gets the parse name of the file
.
A parse name is a UTF-8 string that describes the
file such that one can get the GFile
back using g_file_parse_name().
g_file_get_path
Gets the local pathname for GFile
, if one exists. If non-NULL
, this is
guaranteed to be an absolute, canonical path. It might contain symlinks.
g_file_get_uri_scheme
Gets the URI scheme for a GFile
.
RFC 3986 decodes the scheme as:
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
Common schemes include “file”, “http”, “ftp”, etc.
g_file_load_bytes_finish
Completes an asynchronous request to g_file_load_bytes_async().
since: 2.56
g_file_load_contents
Loads the content of the file into memory. The data is always
zero-terminated, but this is not included in the resultant length
.
The returned contents
should be freed with g_free()
when no longer needed.
g_file_load_contents_finish
Finishes an asynchronous load of the file
‘s contents.
The contents are placed in contents
, and length
is set to the
size of the contents
string. The contents
should be freed with
g_free()
when no longer needed. If etag_out
is present, it will be
set to the new entity tag for the file
.
g_file_load_partial_contents_async
Reads the partial contents of a file. A GFileReadMoreCallback
should
be used to stop reading from the file when appropriate, else this
function will behave exactly as g_file_load_contents_async(). This
operation can be finished by g_file_load_partial_contents_finish().
g_file_load_partial_contents_finish
Finishes an asynchronous partial load operation that was started
with g_file_load_partial_contents_async(). The data is always
zero-terminated, but this is not included in the resultant length
.
The returned contents
should be freed with g_free()
when no longer needed.
g_file_make_directory
Creates a directory. Note that this will only create a child directory
of the immediate parent directory of the path or URI given by the GFile
.
To recursively create directories, see g_file_make_directory_with_parents().
This function will fail if the parent directory does not exist, setting
error
to G_IO_ERROR_NOT_FOUND
. If the file system doesn’t support
creating directories, this function will fail, setting error
to
G_IO_ERROR_NOT_SUPPORTED
.
g_file_make_directory_finish
Finishes an asynchronous directory creation, started with g_file_make_directory_async().
since: 2.38
g_file_make_directory_with_parents
Creates a directory and any parent directories that may not
exist similar to ‘mkdir -p’. If the file system does not support
creating directories, this function will fail, setting error
to
G_IO_ERROR_NOT_SUPPORTED
. If the directory itself already exists,
this function will fail setting error
to G_IO_ERROR_EXISTS
, unlike
the similar g_mkdir_with_parents().
since: 2.18
g_file_make_symbolic_link
Creates a symbolic link named file
which contains the string
symlink_value
.
g_file_make_symbolic_link_async
Asynchronously creates a symbolic link named file
which contains the
string symlink_value
.
since: 2.74
g_file_make_symbolic_link_finish
Finishes an asynchronous symbolic link creation, started with g_file_make_symbolic_link_async().
since: 2.74
g_file_measure_disk_usage_finish
Collects the results from an earlier call to
g_file_measure_disk_usage_async(). See g_file_measure_disk_usage()
for
more information.
since: 2.38
g_file_monitor
Obtains a file or directory monitor for the given file, depending on the type of the file.
since: 2.18
g_file_monitor_directory
Obtains a directory monitor for the given file. This may fail if directory monitoring is not supported.
g_file_monitor_file
Obtains a file monitor for the given file. If no file notification mechanism exists, then regular polling of the file is used.
g_file_mount_enclosing_volume
Starts a mount_operation
, mounting the volume that contains
the file location
.
g_file_mount_enclosing_volume_finish
Finishes a mount operation started by g_file_mount_enclosing_volume().
g_file_mount_mountable
Mounts a file of type G_FILE_TYPE_MOUNTABLE.
Using mount_operation
, you can request callbacks when, for instance,
passwords are needed during authentication.
g_file_move
Tries to move the file or directory source
to the location specified
by destination
. If native move operations are supported then this is
used, otherwise a copy + delete fallback is used. The native
implementation may support moving directories (for instance on moves
inside the same filesystem), but the fallback code does not.
g_file_move_async
Asynchronously moves a file source
to the location of destination
. For details of the behaviour, see g_file_move().
since: 2.72
g_file_move_async_with_closures
Version of g_file_move_async()
using closures instead of callbacks for
easier binding in other languages.
since: 2.82
g_file_move_finish
Finishes an asynchronous file movement, started with g_file_move_async().
since: 2.72
g_file_open_readwrite
Opens an existing file for reading and writing. The result is
a GFileIOStream
that can be used to read and write the contents
of the file.
since: 2.22
g_file_open_readwrite_finish
Finishes an asynchronous file read operation started with g_file_open_readwrite_async().
since: 2.22
g_file_peek_path
Exactly like g_file_get_path(), but caches the result via
g_object_set_qdata_full(). This is useful for example in C
applications which mix g_file_*
APIs with native ones. It
also avoids an extra duplicated string when possible, so will be
generally more efficient.
since: 2.56
g_file_poll_mountable_finish
Finishes a poll operation. See g_file_poll_mountable()
for details.
since: 2.22
g_file_query_default_handler
Returns the GAppInfo
that is registered as the default
application to handle the file specified by file
.
g_file_query_default_handler_finish
Finishes a g_file_query_default_handler_async()
operation.
since: 2.60
g_file_query_file_type
Utility function to inspect the GFileType
of a file. This is
implemented using g_file_query_info()
and as such does blocking I/O.
since: 2.18
g_file_query_filesystem_info
Similar to g_file_query_info(), but obtains information
about the filesystem the file
is on, rather than the file itself.
For instance the amount of space available and the type of
the filesystem.
g_file_query_filesystem_info_async
Asynchronously gets the requested information about the filesystem
that the specified file
is on. The result is a GFileInfo
object
that contains key-value attributes (such as type or size for the file).
g_file_query_filesystem_info_finish
Finishes an asynchronous filesystem info query. See g_file_query_filesystem_info_async().
g_file_query_info
Gets the requested information about specified file
.
The result is a GFileInfo
object that contains key-value
attributes (such as the type or size of the file).
g_file_query_info_async
Asynchronously gets the requested information about specified file
.
The result is a GFileInfo
object that contains key-value attributes
(such as type or size for the file).
g_file_query_writable_namespaces
Obtain the list of attribute namespaces where new attributes can be created by a user. An example of this is extended attributes (in the “xattr” namespace).
g_file_read
Opens a file for reading. The result is a GFileInputStream
that
can be used to read the contents of the file.
g_file_replace
Returns an output stream for overwriting the file, possibly creating a backup copy of the file first. If the file doesn’t exist, it will be created.
g_file_replace_async
Asynchronously overwrites the file, replacing the contents, possibly creating a backup copy of the file first.
g_file_replace_contents_async
Starts an asynchronous replacement of file
with the given
contents
of length
bytes. etag
will replace the document’s
current entity tag.
g_file_replace_contents_bytes_async
Same as g_file_replace_contents_async()
but takes a GBytes
input instead.
This function will keep a ref on contents
until the operation is done.
Unlike g_file_replace_contents_async()
this allows forgetting about the
content without waiting for the callback.
since: 2.40
g_file_replace_contents_finish
Finishes an asynchronous replace of the given file
. See
g_file_replace_contents_async(). Sets new_etag
to the new entity
tag for the document, if present.
g_file_replace_finish
Finishes an asynchronous file replace operation started with g_file_replace_async().
g_file_replace_readwrite
Returns an output stream for overwriting the file in readwrite mode, possibly creating a backup copy of the file first. If the file doesn’t exist, it will be created.
since: 2.22
g_file_replace_readwrite_async
Asynchronously overwrites the file in read-write mode, replacing the contents, possibly creating a backup copy of the file first.
since: 2.22
g_file_replace_readwrite_finish
Finishes an asynchronous file replace operation started with g_file_replace_readwrite_async().
since: 2.22
g_file_set_attribute_byte_string
Sets attribute
of type G_FILE_ATTRIBUTE_TYPE_BYTE_STRING
to value
.
If attribute
is of a different type, this operation will fail,
returning FALSE
.
g_file_set_attribute_int32
Sets attribute
of type G_FILE_ATTRIBUTE_TYPE_INT32
to value
.
If attribute
is of a different type, this operation will fail.
g_file_set_attribute_int64
Sets attribute
of type G_FILE_ATTRIBUTE_TYPE_INT64
to value
.
If attribute
is of a different type, this operation will fail.
g_file_set_attribute_string
Sets attribute
of type G_FILE_ATTRIBUTE_TYPE_STRING
to value
.
If attribute
is of a different type, this operation will fail.
g_file_set_attribute_uint32
Sets attribute
of type G_FILE_ATTRIBUTE_TYPE_UINT32
to value
.
If attribute
is of a different type, this operation will fail.
g_file_set_attribute_uint64
Sets attribute
of type G_FILE_ATTRIBUTE_TYPE_UINT64
to value
.
If attribute
is of a different type, this operation will fail.
g_file_set_attributes_finish
Finishes setting an attribute started in g_file_set_attributes_async().
g_file_set_attributes_from_info
Tries to set all attributes in the GFileInfo
on the target
values, not stopping on the first error.
g_file_set_display_name_finish
Finishes setting a display name started with g_file_set_display_name_async().
g_file_start_mountable
Starts a file of type G_FILE_TYPE_MOUNTABLE
.
Using start_operation
, you can request callbacks when, for instance,
passwords are needed during authentication.
since: 2.22
g_file_start_mountable_finish
Finishes a start operation. See g_file_start_mountable()
for details.
since: 2.22
g_file_stop_mountable_finish
Finishes a stop operation, see g_file_stop_mountable()
for details.
since: 2.22
g_file_supports_thread_contexts
Checks if file
supports
[thread-default contexts][g-main-context-push-thread-default-context].
If this returns FALSE
, you cannot perform asynchronous operations on
file
in a thread that has a thread-default context.
since: 2.22
g_file_trash
Sends file
to the “Trashcan”, if possible. This is similar to
deleting it, but the user can recover it before emptying the trashcan.
Trashing is disabled for system mounts by default (see
g_unix_mount_entry_is_system_internal()), so this call can return the
G_IO_ERROR_NOT_SUPPORTED
error. Since GLib 2.66, the x-gvfs-notrash
unix
mount option can be used to disable g_file_trash()
support for particular
mounts, the G_IO_ERROR_NOT_SUPPORTED
error will be returned in that case.
Since 2.82, the x-gvfs-trash
unix mount option can be used to enable
g_file_trash()
support for particular system mounts.
g_file_trash_finish
Finishes an asynchronous file trashing operation, started with g_file_trash_async().
since: 2.38
g_file_unmount_mountable_finish
Finishes an unmount operation, see g_file_unmount_mountable()
for details.
deprecated: 2.22
g_file_unmount_mountable_with_operation_finish
Finishes an unmount operation,
see g_file_unmount_mountable_with_operation()
for details.
since: 2.22
Interface structure
struct GioFileIface {
GTypeInterface g_iface;
GFile* (* dup) (
GFile* file
);
guint (* hash) (
GFile* file
);
gboolean (* equal) (
GFile* file1,
GFile* file2
);
gboolean (* is_native) (
GFile* file
);
gboolean (* has_uri_scheme) (
GFile* file,
const char* uri_scheme
);
char* (* get_uri_scheme) (
GFile* file
);
char* (* get_basename) (
GFile* file
);
char* (* get_path) (
GFile* file
);
char* (* get_uri) (
GFile* file
);
char* (* get_parse_name) (
GFile* file
);
GFile* (* get_parent) (
GFile* file
);
gboolean (* prefix_matches) (
GFile* prefix,
GFile* file
);
char* (* get_relative_path) (
GFile* parent,
GFile* descendant
);
GFile* (* resolve_relative_path) (
GFile* file,
const char* relative_path
);
GFile* (* get_child_for_display_name) (
GFile* file,
const char* display_name,
GError** error
);
GFileEnumerator* (* enumerate_children) (
GFile* file,
const char* attributes,
GFileQueryInfoFlags flags,
GCancellable* cancellable,
GError** error
);
void (* enumerate_children_async) (
GFile* file,
const char* attributes,
GFileQueryInfoFlags flags,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GFileEnumerator* (* enumerate_children_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
GFileInfo* (* query_info) (
GFile* file,
const char* attributes,
GFileQueryInfoFlags flags,
GCancellable* cancellable,
GError** error
);
void (* query_info_async) (
GFile* file,
const char* attributes,
GFileQueryInfoFlags flags,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GFileInfo* (* query_info_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
GFileInfo* (* query_filesystem_info) (
GFile* file,
const char* attributes,
GCancellable* cancellable,
GError** error
);
void (* query_filesystem_info_async) (
GFile* file,
const char* attributes,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GFileInfo* (* query_filesystem_info_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
GMount* (* find_enclosing_mount) (
GFile* file,
GCancellable* cancellable,
GError** error
);
void (* find_enclosing_mount_async) (
GFile* file,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GMount* (* find_enclosing_mount_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
GFile* (* set_display_name) (
GFile* file,
const char* display_name,
GCancellable* cancellable,
GError** error
);
void (* set_display_name_async) (
GFile* file,
const char* display_name,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GFile* (* set_display_name_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
GFileAttributeInfoList* (* query_settable_attributes) (
GFile* file,
GCancellable* cancellable,
GError** error
);
void (* _query_settable_attributes_async) (
void
);
void (* _query_settable_attributes_finish) (
void
);
GFileAttributeInfoList* (* query_writable_namespaces) (
GFile* file,
GCancellable* cancellable,
GError** error
);
void (* _query_writable_namespaces_async) (
void
);
void (* _query_writable_namespaces_finish) (
void
);
gboolean (* set_attribute) (
GFile* file,
const char* attribute,
GFileAttributeType type,
gpointer value_p,
GFileQueryInfoFlags flags,
GCancellable* cancellable,
GError** error
);
gboolean (* set_attributes_from_info) (
GFile* file,
GFileInfo* info,
GFileQueryInfoFlags flags,
GCancellable* cancellable,
GError** error
);
void (* set_attributes_async) (
GFile* file,
GFileInfo* info,
GFileQueryInfoFlags flags,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* set_attributes_finish) (
GFile* file,
GAsyncResult* result,
GFileInfo** info,
GError** error
);
GFileInputStream* (* read_fn) (
GFile* file,
GCancellable* cancellable,
GError** error
);
void (* read_async) (
GFile* file,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GFileInputStream* (* read_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
GFileOutputStream* (* append_to) (
GFile* file,
GFileCreateFlags flags,
GCancellable* cancellable,
GError** error
);
void (* append_to_async) (
GFile* file,
GFileCreateFlags flags,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GFileOutputStream* (* append_to_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
GFileOutputStream* (* create) (
GFile* file,
GFileCreateFlags flags,
GCancellable* cancellable,
GError** error
);
void (* create_async) (
GFile* file,
GFileCreateFlags flags,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GFileOutputStream* (* create_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
GFileOutputStream* (* replace) (
GFile* file,
const char* etag,
gboolean make_backup,
GFileCreateFlags flags,
GCancellable* cancellable,
GError** error
);
void (* replace_async) (
GFile* file,
const char* etag,
gboolean make_backup,
GFileCreateFlags flags,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GFileOutputStream* (* replace_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
gboolean (* delete_file) (
GFile* file,
GCancellable* cancellable,
GError** error
);
void (* delete_file_async) (
GFile* file,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* delete_file_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
gboolean (* trash) (
GFile* file,
GCancellable* cancellable,
GError** error
);
void (* trash_async) (
GFile* file,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* trash_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
gboolean (* make_directory) (
GFile* file,
GCancellable* cancellable,
GError** error
);
void (* make_directory_async) (
GFile* file,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* make_directory_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
gboolean (* make_symbolic_link) (
GFile* file,
const char* symlink_value,
GCancellable* cancellable,
GError** error
);
void (* make_symbolic_link_async) (
GFile* file,
const char* symlink_value,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* make_symbolic_link_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
gboolean (* copy) (
GFile* source,
GFile* destination,
GFileCopyFlags flags,
GCancellable* cancellable,
GFileProgressCallback progress_callback,
gpointer progress_callback_data,
GError** error
);
void (* copy_async) (
GFile* source,
GFile* destination,
GFileCopyFlags flags,
int io_priority,
GCancellable* cancellable,
GFileProgressCallback progress_callback,
gpointer progress_callback_data,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* copy_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
gboolean (* move) (
GFile* source,
GFile* destination,
GFileCopyFlags flags,
GCancellable* cancellable,
GFileProgressCallback progress_callback,
gpointer progress_callback_data,
GError** error
);
void (* move_async) (
GFile* source,
GFile* destination,
GFileCopyFlags flags,
int io_priority,
GCancellable* cancellable,
GFileProgressCallback progress_callback,
gpointer progress_callback_data,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* move_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
void (* mount_mountable) (
GFile* file,
GMountMountFlags flags,
GMountOperation* mount_operation,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GFile* (* mount_mountable_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
void (* unmount_mountable) (
GFile* file,
GMountUnmountFlags flags,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* unmount_mountable_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
void (* eject_mountable) (
GFile* file,
GMountUnmountFlags flags,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* eject_mountable_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
void (* mount_enclosing_volume) (
GFile* location,
GMountMountFlags flags,
GMountOperation* mount_operation,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* mount_enclosing_volume_finish) (
GFile* location,
GAsyncResult* result,
GError** error
);
GFileMonitor* (* monitor_dir) (
GFile* file,
GFileMonitorFlags flags,
GCancellable* cancellable,
GError** error
);
GFileMonitor* (* monitor_file) (
GFile* file,
GFileMonitorFlags flags,
GCancellable* cancellable,
GError** error
);
GFileIOStream* (* open_readwrite) (
GFile* file,
GCancellable* cancellable,
GError** error
);
void (* open_readwrite_async) (
GFile* file,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GFileIOStream* (* open_readwrite_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
GFileIOStream* (* create_readwrite) (
GFile* file,
GFileCreateFlags flags,
GCancellable* cancellable,
GError** error
);
void (* create_readwrite_async) (
GFile* file,
GFileCreateFlags flags,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GFileIOStream* (* create_readwrite_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
GFileIOStream* (* replace_readwrite) (
GFile* file,
const char* etag,
gboolean make_backup,
GFileCreateFlags flags,
GCancellable* cancellable,
GError** error
);
void (* replace_readwrite_async) (
GFile* file,
const char* etag,
gboolean make_backup,
GFileCreateFlags flags,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GFileIOStream* (* replace_readwrite_finish) (
GFile* file,
GAsyncResult* res,
GError** error
);
void (* start_mountable) (
GFile* file,
GDriveStartFlags flags,
GMountOperation* start_operation,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* start_mountable_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
void (* stop_mountable) (
GFile* file,
GMountUnmountFlags flags,
GMountOperation* mount_operation,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* stop_mountable_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
gboolean supports_thread_contexts;
void (* unmount_mountable_with_operation) (
GFile* file,
GMountUnmountFlags flags,
GMountOperation* mount_operation,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* unmount_mountable_with_operation_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
void (* eject_mountable_with_operation) (
GFile* file,
GMountUnmountFlags flags,
GMountOperation* mount_operation,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* eject_mountable_with_operation_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
void (* poll_mountable) (
GFile* file,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* poll_mountable_finish) (
GFile* file,
GAsyncResult* result,
GError** error
);
gboolean (* measure_disk_usage) (
GFile* file,
GFileMeasureFlags flags,
GCancellable* cancellable,
GFileMeasureProgressCallback progress_callback,
gpointer progress_data,
guint64* disk_usage,
guint64* num_dirs,
guint64* num_files,
GError** error
);
void (* measure_disk_usage_async) (
GFile* file,
GFileMeasureFlags flags,
gint io_priority,
GCancellable* cancellable,
GFileMeasureProgressCallback progress_callback,
gpointer progress_data,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* measure_disk_usage_finish) (
GFile* file,
GAsyncResult* result,
guint64* disk_usage,
guint64* num_dirs,
guint64* num_files,
GError** error
);
gboolean (* query_exists) (
GFile* file,
GCancellable* cancellable
);
}
An interface for writing VFS file handles.
Interface members
g_iface |
|
The parent interface. |
|
dup |
|
Duplicates a |
|
hash |
|
Creates a hash of a |
|
equal |
|
Checks equality of two given |
|
is_native |
|
Checks to see if a file is native to the system. |
|
has_uri_scheme |
|
Checks to see if a |
|
get_uri_scheme |
|
Gets the URI scheme for a |
|
get_basename |
|
Gets the basename for a given |
|
get_path |
|
Gets the current path within a |
|
get_uri |
|
Gets a URI for the path within a |
|
get_parse_name |
|
Gets the parsed name for the |
|
get_parent |
|
Gets the parent directory for the |
|
prefix_matches |
|
Checks whether a |
|
get_relative_path |
|
Gets the path for a |
|
resolve_relative_path |
|
Resolves a relative path for a |
|
get_child_for_display_name |
|
Gets the child |
|
enumerate_children |
|
Gets a |
|
enumerate_children_async |
|
Asynchronously gets a |
|
enumerate_children_finish |
|
Finishes asynchronously enumerating the children. |
|
query_info |
|
Gets the |
|
query_info_async |
|
Asynchronously gets the |
|
query_info_finish |
|
Finishes an asynchronous query info operation. |
|
query_filesystem_info |
|
Gets a |
|
query_filesystem_info_async |
|
Asynchronously gets a |
|
query_filesystem_info_finish |
|
Finishes asynchronously getting the file system info. |
|
find_enclosing_mount |
|
Gets a |
|
find_enclosing_mount_async |
|
Asynchronously gets the |
|
find_enclosing_mount_finish |
|
Finishes asynchronously getting the volume. |
|
set_display_name |
|
Sets the display name for a |
|
set_display_name_async |
|
Asynchronously sets a |
|
set_display_name_finish |
|
Finishes asynchronously setting a |
|
query_settable_attributes |
|
Returns a list of |
|
_query_settable_attributes_async |
|
Asynchronously gets a list of |
|
_query_settable_attributes_finish |
|
Finishes asynchronously querying settable attributes. |
|
query_writable_namespaces |
|
Returns a list of |
|
_query_writable_namespaces_async |
|
Asynchronously gets a list of |
|
_query_writable_namespaces_finish |
|
Finishes asynchronously querying the writable namespaces. |
|
set_attribute |
|
Sets a |
|
set_attributes_from_info |
|
Sets a |
|
set_attributes_async |
|
Asynchronously sets a file’s attributes. |
|
set_attributes_finish |
|
Finishes setting a file’s attributes asynchronously. |
|
read_fn |
|
Reads a file asynchronously. |
|
read_async |
|
Asynchronously reads a file. |
|
read_finish |
|
Finishes asynchronously reading a file. |
|
append_to |
|
Writes to the end of a file. |
|
append_to_async |
|
Asynchronously writes to the end of a file. |
|
append_to_finish |
|
Finishes an asynchronous file append operation. |
|
create |
|
Creates a new file. |
|
create_async |
|
Asynchronously creates a file. |
|
create_finish |
|
Finishes asynchronously creating a file. |
|
replace |
|
Replaces the contents of a file. |
|
replace_async |
|
Asynchronously replaces the contents of a file. |
|
replace_finish |
|
Finishes asynchronously replacing a file. |
|
delete_file |
|
Deletes a file. |
|
delete_file_async |
|
Asynchronously deletes a file. |
|
delete_file_finish |
|
Finishes an asynchronous delete. |
|
trash |
|
Sends a |
|
trash_async |
|
Asynchronously sends a |
|
trash_finish |
|
Finishes an asynchronous file trashing operation. |
|
make_directory |
|
Makes a directory. |
|
make_directory_async |
|
Asynchronously makes a directory. |
|
make_directory_finish |
|
Finishes making a directory asynchronously. |
|
make_symbolic_link |
|
Makes a symbolic link. |
|
make_symbolic_link_async |
|
Asynchronously makes a symbolic link. |
|
make_symbolic_link_finish |
|
Finishes making a symbolic link asynchronously. |
|
copy |
|
Copies a file. |
|
copy_async |
|
Asynchronously copies a file. |
|
copy_finish |
|
Finishes an asynchronous copy operation. |
|
move |
|
Moves a file. |
|
move_async |
|
Asynchronously moves a file. Since: 2.72. |
|
move_finish |
|
Finishes an asynchronous move operation. Since: 2.72. |
|
mount_mountable |
|
Mounts a mountable object. |
|
mount_mountable_finish |
|
Finishes a mounting operation. |
|
unmount_mountable |
|
Unmounts a mountable object. |
|
unmount_mountable_finish |
|
Finishes an unmount operation. |
|
eject_mountable |
|
Ejects a mountable. |
|
eject_mountable_finish |
|
Finishes an eject operation. |
|
mount_enclosing_volume |
|
Mounts a specified location. |
|
mount_enclosing_volume_finish |
|
Finishes mounting a specified location. |
|
monitor_dir |
|
Creates a |
|
monitor_file |
|
Creates a |
|
open_readwrite |
|
Open file read/write. Since 2.22. |
|
open_readwrite_async |
|
Asynchronously opens file read/write. Since 2.22. |
|
open_readwrite_finish |
|
Finishes an asynchronous open read/write. Since 2.22. |
|
create_readwrite |
|
Creates file read/write. Since 2.22. |
|
create_readwrite_async |
|
Asynchronously creates file read/write. Since 2.22. |
|
create_readwrite_finish |
|
Finishes an asynchronous creates read/write. Since 2.22. |
|
replace_readwrite |
|
Replaces file read/write. Since 2.22. |
|
replace_readwrite_async |
|
Asynchronously replaces file read/write. Since 2.22. |
|
replace_readwrite_finish |
|
Finishes an asynchronous replace read/write. Since 2.22. |
|
start_mountable |
|
Starts a mountable object. Since 2.22. |
|
start_mountable_finish |
|
Finishes a start operation. Since 2.22. |
|
stop_mountable |
|
Stops a mountable. Since 2.22. |
|
stop_mountable_finish |
|
Finishes a stop operation. Since 2.22. |
|
supports_thread_contexts |
|
A boolean that indicates whether the |
|
unmount_mountable_with_operation |
|
Unmounts a mountable object using a |
|
unmount_mountable_with_operation_finish |
|
Finishes an unmount operation using a |
|
eject_mountable_with_operation |
|
Ejects a mountable object using a |
|
eject_mountable_with_operation_finish |
|
Finishes an eject operation using a |
|
poll_mountable |
|
Polls a mountable object for media changes. Since 2.22. |
|
poll_mountable_finish |
|
Finishes a poll operation for media changes. Since 2.22. |
|
measure_disk_usage |
|
Recursively measures the disk usage of |
|
measure_disk_usage_async |
|
Asynchronously recursively measures the disk usage of |
|
measure_disk_usage_finish |
|
Finishes an asynchronous recursive measurement of the disk usage of |
|
query_exists |
|
Queries whether a file exists. Since 2.84. |
Virtual methods
Gio.File.append_to
Gets an output stream for appending data to the file. If the file doesn’t already exist it is created.
Gio.File.append_to_finish
Finishes an asynchronous file append operation started with g_file_append_to_async().
Gio.File.copy
Copies the file source
to the location specified by destination
.
Can not handle recursive copies of directories.
Gio.File.copy_async
Copies the file source
to the location specified by destination
asynchronously. For details of the behaviour, see g_file_copy().
Gio.File.create
Creates a new file and returns an output stream for writing to it. The file must not already exist.
Gio.File.create_async
Asynchronously creates a new file and returns an output stream for writing to it. The file must not already exist.
Gio.File.create_finish
Finishes an asynchronous file create operation started with g_file_create_async().
Gio.File.create_readwrite
Creates a new file and returns a stream for reading and writing to it. The file must not already exist.
since: 2.22
Gio.File.create_readwrite_async
Asynchronously creates a new file and returns a stream for reading and writing to it. The file must not already exist.
since: 2.22
Gio.File.create_readwrite_finish
Finishes an asynchronous file create operation started with g_file_create_readwrite_async().
since: 2.22
Gio.File.delete_file
Deletes a file. If the file
is a directory, it will only be
deleted if it is empty. This has the same semantics as g_unlink().
Gio.File.delete_file_async
Asynchronously delete a file. If the file
is a directory, it will
only be deleted if it is empty. This has the same semantics as g_unlink().
since: 2.34
Gio.File.delete_file_finish
Finishes deleting a file started with g_file_delete_async().
since: 2.34
Gio.File.dup
Duplicates a GFile
handle. This operation does not duplicate
the actual file or directory represented by the GFile
; see
g_file_copy()
if attempting to copy a file.
Gio.File.eject_mountable
Starts an asynchronous eject on a mountable.
When this operation has completed, callback
will be called with
user_user
data, and the operation can be finalized with g_file_eject_mountable_finish().
deprecated: 2.22
Gio.File.eject_mountable_finish
Finishes an asynchronous eject operation started by g_file_eject_mountable().
deprecated: 2.22
Gio.File.eject_mountable_with_operation
Starts an asynchronous eject on a mountable.
When this operation has completed, callback
will be called with
user_user
data, and the operation can be finalized with g_file_eject_mountable_with_operation_finish().
since: 2.22
Gio.File.eject_mountable_with_operation_finish
Finishes an asynchronous eject operation started by g_file_eject_mountable_with_operation().
since: 2.22
Gio.File.enumerate_children
Gets the requested information about the files in a directory.
The result is a GFileEnumerator
object that will give out
GFileInfo
objects for all the files in the directory.
Gio.File.enumerate_children_async
Asynchronously gets the requested information about the files
in a directory. The result is a GFileEnumerator
object that will
give out GFileInfo
objects for all the files in the directory.
Gio.File.enumerate_children_finish
Finishes an async enumerate children operation. See g_file_enumerate_children_async().
Gio.File.find_enclosing_mount_finish
Finishes an asynchronous find mount request. See g_file_find_enclosing_mount_async().
Gio.File.get_child_for_display_name
Gets the child of file
for a given display_name
(i.e. a UTF-8
version of the name). If this function fails, it returns NULL
and error
will be set. This is very useful when constructing a
GFile
for a new file and the user entered the filename in the
user interface, for instance when you select a directory and
type a filename in the file selector.
Gio.File.get_parent
Gets the parent directory for the file
.
If the file
represents the root directory of the
file system, then NULL
will be returned.
Gio.File.get_parse_name
Gets the parse name of the file
.
A parse name is a UTF-8 string that describes the
file such that one can get the GFile
back using g_file_parse_name().
Gio.File.get_path
Gets the local pathname for GFile
, if one exists. If non-NULL
, this is
guaranteed to be an absolute, canonical path. It might contain symlinks.
Gio.File.get_uri_scheme
Gets the URI scheme for a GFile
.
RFC 3986 decodes the scheme as:
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
Common schemes include “file”, “http”, “ftp”, etc.
Gio.File.make_directory
Creates a directory. Note that this will only create a child directory
of the immediate parent directory of the path or URI given by the GFile
.
To recursively create directories, see g_file_make_directory_with_parents().
This function will fail if the parent directory does not exist, setting
error
to G_IO_ERROR_NOT_FOUND
. If the file system doesn’t support
creating directories, this function will fail, setting error
to
G_IO_ERROR_NOT_SUPPORTED
.
Gio.File.make_directory_finish
Finishes an asynchronous directory creation, started with g_file_make_directory_async().
since: 2.38
Gio.File.make_symbolic_link
Creates a symbolic link named file
which contains the string
symlink_value
.
Gio.File.make_symbolic_link_async
Asynchronously creates a symbolic link named file
which contains the
string symlink_value
.
since: 2.74
Gio.File.make_symbolic_link_finish
Finishes an asynchronous symbolic link creation, started with g_file_make_symbolic_link_async().
since: 2.74
Gio.File.measure_disk_usage_finish
Collects the results from an earlier call to
g_file_measure_disk_usage_async(). See g_file_measure_disk_usage()
for
more information.
since: 2.38
Gio.File.monitor_dir
Obtains a directory monitor for the given file. This may fail if directory monitoring is not supported.
Gio.File.monitor_file
Obtains a file monitor for the given file. If no file notification mechanism exists, then regular polling of the file is used.
Gio.File.mount_enclosing_volume
Starts a mount_operation
, mounting the volume that contains
the file location
.
Gio.File.mount_enclosing_volume_finish
Finishes a mount operation started by g_file_mount_enclosing_volume().
Gio.File.mount_mountable
Mounts a file of type G_FILE_TYPE_MOUNTABLE.
Using mount_operation
, you can request callbacks when, for instance,
passwords are needed during authentication.
Gio.File.mount_mountable_finish
Finishes a mount operation. See g_file_mount_mountable()
for details.
Gio.File.move
Tries to move the file or directory source
to the location specified
by destination
. If native move operations are supported then this is
used, otherwise a copy + delete fallback is used. The native
implementation may support moving directories (for instance on moves
inside the same filesystem), but the fallback code does not.
Gio.File.move_async
Asynchronously moves a file source
to the location of destination
. For details of the behaviour, see g_file_move().
since: 2.72
Gio.File.move_finish
Finishes an asynchronous file movement, started with g_file_move_async().
since: 2.72
Gio.File.open_readwrite
Opens an existing file for reading and writing. The result is
a GFileIOStream
that can be used to read and write the contents
of the file.
since: 2.22
Gio.File.open_readwrite_finish
Finishes an asynchronous file read operation started with g_file_open_readwrite_async().
since: 2.22
Gio.File.poll_mountable_finish
Finishes a poll operation. See g_file_poll_mountable()
for details.
since: 2.22
Gio.File.query_filesystem_info
Similar to g_file_query_info(), but obtains information
about the filesystem the file
is on, rather than the file itself.
For instance the amount of space available and the type of
the filesystem.
Gio.File.query_filesystem_info_async
Asynchronously gets the requested information about the filesystem
that the specified file
is on. The result is a GFileInfo
object
that contains key-value attributes (such as type or size for the file).
Gio.File.query_filesystem_info_finish
Finishes an asynchronous filesystem info query. See g_file_query_filesystem_info_async().
Gio.File.query_info
Gets the requested information about specified file
.
The result is a GFileInfo
object that contains key-value
attributes (such as the type or size of the file).
Gio.File.query_info_async
Asynchronously gets the requested information about specified file
.
The result is a GFileInfo
object that contains key-value attributes
(such as type or size for the file).
Gio.File.query_writable_namespaces
Obtain the list of attribute namespaces where new attributes can be created by a user. An example of this is extended attributes (in the “xattr” namespace).
Gio.File.read_fn
Opens a file for reading. The result is a GFileInputStream
that
can be used to read the contents of the file.
Gio.File.replace
Returns an output stream for overwriting the file, possibly creating a backup copy of the file first. If the file doesn’t exist, it will be created.
Gio.File.replace_async
Asynchronously overwrites the file, replacing the contents, possibly creating a backup copy of the file first.
Gio.File.replace_finish
Finishes an asynchronous file replace operation started with g_file_replace_async().
Gio.File.replace_readwrite
Returns an output stream for overwriting the file in readwrite mode, possibly creating a backup copy of the file first. If the file doesn’t exist, it will be created.
since: 2.22
Gio.File.replace_readwrite_async
Asynchronously overwrites the file in read-write mode, replacing the contents, possibly creating a backup copy of the file first.
since: 2.22
Gio.File.replace_readwrite_finish
Finishes an asynchronous file replace operation started with g_file_replace_readwrite_async().
since: 2.22
Gio.File.set_attributes_finish
Finishes setting an attribute started in g_file_set_attributes_async().
Gio.File.set_attributes_from_info
Tries to set all attributes in the GFileInfo
on the target
values, not stopping on the first error.
Gio.File.set_display_name_finish
Finishes setting a display name started with g_file_set_display_name_async().
Gio.File.start_mountable
Starts a file of type G_FILE_TYPE_MOUNTABLE
.
Using start_operation
, you can request callbacks when, for instance,
passwords are needed during authentication.
since: 2.22
Gio.File.start_mountable_finish
Finishes a start operation. See g_file_start_mountable()
for details.
since: 2.22
Gio.File.stop_mountable_finish
Finishes a stop operation, see g_file_stop_mountable()
for details.
since: 2.22
Gio.File.trash
Sends file
to the “Trashcan”, if possible. This is similar to
deleting it, but the user can recover it before emptying the trashcan.
Trashing is disabled for system mounts by default (see
g_unix_mount_entry_is_system_internal()), so this call can return the
G_IO_ERROR_NOT_SUPPORTED
error. Since GLib 2.66, the x-gvfs-notrash
unix
mount option can be used to disable g_file_trash()
support for particular
mounts, the G_IO_ERROR_NOT_SUPPORTED
error will be returned in that case.
Since 2.82, the x-gvfs-trash
unix mount option can be used to enable
g_file_trash()
support for particular system mounts.
Gio.File.trash_finish
Finishes an asynchronous file trashing operation, started with g_file_trash_async().
since: 2.38
Gio.File.unmount_mountable_finish
Finishes an unmount operation, see g_file_unmount_mountable()
for details.
deprecated: 2.22
Gio.File.unmount_mountable_with_operation
Unmounts a file of type G_FILE_TYPE_MOUNTABLE
.
since: 2.22
Gio.File.unmount_mountable_with_operation_finish
Finishes an unmount operation,
see g_file_unmount_mountable_with_operation()
for details.
since: 2.22