<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:
file:new-for-path if you have a path.
file:new-for-uri if you have a URI.
file:new-for-commandline-arg
or file:new-for-commandline-arg-and-cwd
for a command line argument.
file:new-tmp to create a temporary file from
a template.
file:new-tmp-async to asynchronously
create a temporary file.
file:new-tmp-dir-async to
asynchronously create a temporary directory.
file:parse-name from a UTF-8 string gotten
from file:get-parse-name.
Gio.File.new_build_filename or 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 file:get-parent to get an identifier for the parent
directory, file:get-child to get a child
within a directory, and 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 file:get-parent on two
different files.
All <GFile>s have a basename (get with
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
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:
file:mount-mountable to mount a
mountable file.
file:unmount-mountable-with-operation
to unmount a mountable file.
file:eject-mountable-with-operation to
eject a mountable file.
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 description of HTTP ETags in
RFC9110.
<GFile> Entity Tags are a very similar concept.
Gets an output stream for appending data to the file. If the file doesn’t already exist it is created.
By default files created are generally readable by everyone, but if you
pass private in flags the file will
be made readable only to the current user, to the level that is
supported on the target filesystem.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Some file systems don’t allow all file names, and may return an
invalid-filename error. If the file is a
directory the is-directory error will be
returned. Other errors are possible too, and depend on what kind of
filesystem the file is on.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileOutputStream>.
a <GFileOutputStream>, or #f on
error. Free the returned object with object:unref.
Asynchronously opens self for appending.
For more details, see file:append-to which
is the synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:append-to-finish to
get the result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file append operation started with
file:append-to-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileOutputStream>.
a valid <GFileOutputStream> or #f
on error. Free the returned object with object:unref.
Prepares the file attribute query string for copying to self.
This function prepares an attribute query string to be passed to
file:query-info to get a list of
attributes normally copied with the file (see file:copy-attributes? for the detailed description).
This function is used by the implementation of file:copy-attributes? and is useful when one needs to
query and set the attributes in two stages (e.g., for recursive move of
a directory).
Passed: a <GFile>.
a <GFile> to copy attributes to
Passed: a <GFileCopyFlags>, or a list of its
symbols, or one of them.
a set of <GFileCopyFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a string.
an attribute query string for file:query-info, or #f if an error occurs.
Copies the file self to the location specified by
destination asynchronously. For details of the behaviour, see
file:copy?.
If progress-callback is not #f, then that function that
will be called just like in file:copy?. The
callback will run in the default main context of the thread calling
file:copy-async — the same context as
callback is run in.
When the operation is finished, callback will be called. You can
then call file:copy-finish? to get the
result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a <GFile>.
destination <GFile>
Passed: a <GFileCopyFlags>, or a list of its
symbols, or one of them.
set of <GFileCopyFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed: a <GCancellable>, or #f.
optional <GCancellable> object, #f to
ignore
Passed: a <GClosure>, or #f.
Passed: a <GClosure>.
function to callback with progress information, or #f if progress
information is not needed
See GFileProgressCallback for how it
is called.
user data to pass to progress-callback
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
the data to pass to callback
Copies the file attributes from self to destination.
Normally only a subset of the file attributes are copied, those that are
copies in a normal file copy operation (which for instance does not
include e.g. owner). However if
all-metadata is specified in flags,
then all the metadata that is possible to copy is copied. This is
useful when implementing move by copy + delete source.
Passed: a <GFile>.
a <GFile> with attributes
Passed: a <GFile>.
a <GFile> to copy attributes to
Passed: a <GFileCopyFlags>, or a list of its
symbols, or one of them.
a set of <GFileCopyFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the attributes were copied successfully, #f
otherwise.
Finishes copying the file started with file:copy-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
a #t on success, #f on error.
Copies the file self to the location specified by destination. Can not handle recursive copies of directories.
If the flag overwrite is specified an
already existing destination file is overwritten.
If the flag nofollow-symlinks is specified
then symlinks will be copied as symlinks, otherwise the target of the
self symlink will be copied.
If the flag all-metadata is specified then
all the metadata that is possible to copy is copied, not just the
default subset (which, for instance, does not include the owner, see
<GFileInfo>).
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If progress-callback is not #f, then the operation can be
monitored by setting this to a
GFileProgressCallback function.
progress-callback-data will be passed to this function. It is
guaranteed that this callback will be called after all data has been
transferred with the total number of bytes copied during the operation.
If the self file does not exist, then the
not-found error is returned, independent on
the status of the destination.
If overwrite is not specified and the target
exists, then the error exists is returned.
If trying to overwrite a file over a directory, the
is-directory error is returned. If trying to
overwrite a directory with a directory the
would-merge error is returned.
If the source is a directory and the target does not exist, or
overwrite is specified and the target is a
file, then the would-recurse error is
returned.
If you are interested in copying the <GFile> object
itself (not the on-disk file), see file:dup.
Passed: a <GFile>.
input <GFile>
Passed: a <GFile>.
destination <GFile>
Passed: a <GFileCopyFlags>, or a list of its
symbols, or one of them.
set of <GFileCopyFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
function to callback with progress information, or #f if progress
information is not needed
See GFileProgressCallback for how it
is called.
Returned: a boolean.
#t on success, #f otherwise.
Not passed: guile-gi supplies it.
user data to pass to progress-callback
Creates a new file and returns an output stream for writing to it. The file must not already exist.
By default files created are generally readable by everyone, but if you
pass private in flags the file will
be made readable only to the current user, to the level that is
supported on the target filesystem.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If a file or directory with this name already exists the
exists error will be returned. Some file
systems don’t allow all file names, and may return an
invalid-filename error, and if the name is to
long filename-too-long will be returned. Other
errors are possible too, and depend on what kind of filesystem the file
is on.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileOutputStream>.
a <GFileOutputStream> for the newly
created file, or #f on error. Free the returned object with
object:unref.
Asynchronously creates a new file and returns an output stream for writing to it. The file must not already exist.
For more details, see file:create which is the
synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:create-finish to get the
result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file create operation started with
file:create-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileOutputStream>.
a <GFileOutputStream> or #f on
error. Free the returned object with object:unref.
Creates a new file and returns a stream for reading and writing to it. The file must not already exist.
By default files created are generally readable by everyone, but if you
pass private in flags the file will
be made readable only to the current user, to the level that is
supported on the target filesystem.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If a file or directory with this name already exists, the
exists error will be returned. Some file
systems don’t allow all file names, and may return an
invalid-filename error, and if the name is too
long, filename-too-long will be returned.
Other errors are possible too, and depend on what kind of filesystem the
file is on.
Note that in many non-local file cases read and write streams are not supported, so make sure you really need to do read and write streaming, rather than just opening for reading or writing.
Passed: a <GFile>.
a <GFile>
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileIOStream>.
a <GFileIOStream> for the newly created file,
or #f on error. Free the returned object with object:unref.
Asynchronously creates a new file and returns a stream for reading and writing to it. The file must not already exist.
For more details, see file:create-readwrite which is the synchronous
version of this call.
When the operation is finished, callback will be called. You can
then call file:create-readwrite-finish to get the
result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file create operation started with
file:create-readwrite-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileIOStream>.
a <GFileIOStream> or #f on error. Free
the returned object with object:unref.
Asynchronously delete a file. If the self is a directory, it will
only be deleted if it is empty. This has the same semantics as
unlink.
Passed: a <GFile>.
input <GFile>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes deleting a file started with file:delete-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the file was deleted. #f otherwise.
Deletes a file. If the self is a directory, it will only be
deleted if it is empty. This has the same semantics as
unlink.
If self doesn’t exist, not-found will be
returned. This allows for deletion to be implemented avoiding
time-of-check
to time-of-use races:
g_autoptr(GError) local_error = NULL;
if (!g_file_delete (my_file, my_cancellable, &local_error) &&
!g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
{
// deletion failed for some reason other than the file not existing:
// so report the error
g_warning ("Failed to delete %s: %s",
g_file_peek_path (my_file), local_error->message);
}
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the file was deleted. #f otherwise.
Duplicates a <GFile> handle. This operation does not
duplicate the actual file or directory represented by the
<GFile>; see file:copy? if
attempting to copy a file.
file:dup is useful when a second handle is needed
to the same underlying file, for use in a separate thread
(<GFile> is not thread-safe). For use within the
same thread, use object:ref to
increment the existing object’s reference count.
This call does no blocking I/O.
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 file:eject-mountable-finish?.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountUnmountFlags>, or a
list of its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous eject operation started by file:eject-mountable.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the self was ejected successfully. #f
otherwise.
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 file:eject-mountable-with-operation-finish?.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountUnmountFlags>, or a
list of its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GMountOperation>,
or #f.
a <GMountOperation>, or #f to avoid
user interaction
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous eject operation started by file:eject-mountable-with-operation.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the self was ejected successfully. #f
otherwise.
Gets the requested information about the files in a directory. The
result is a FileEnumerator object that will give out
FileInfo objects for all the files in the directory.
The attributes value is a string that specifies the file
attributes that should be gathered. It is not an error if it’s not
possible to read a particular requested attribute from a file - it just
won’t be set. attributes should be a comma-separated list of
attributes or attribute wildcards. The wildcard * means all
attributes, and a wildcard like "standard::*" means all
attributes in the standard namespace. An example attribute query be
"standard::*,owner::user". The standard attributes are available
as defines, like FILE_ATTRIBUTE_STANDARD_NAME.
FILE_ATTRIBUTE_STANDARD_NAME should always be specified if you
plan to call FileEnumerator.get_child or
FileEnumerator.iterate on the returned enumerator.
If cancellable is not NULL, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error Gio.IOErrorEnum.CANCELLED
will be returned.
If the file does not exist, the Gio.IOErrorEnum.NOT_FOUND error
will be returned. If the file is not a directory, the
Gio.IOErrorEnum.NOT_DIRECTORY error will be returned. Other
errors are possible too.
Passed: a <GFile>.
input <GFile>
Passed: a string.
an attribute query string
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
a set of <GFileQueryInfoFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileEnumerator>.
A <GFileEnumerator> if successful,
#f on error. Free the returned object with object:unref.
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.
For more details, see file:enumerate-children which is the synchronous
version of this call.
When the operation is finished, callback will be called. You can
then call file:enumerate-children-finish to get the
result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a string.
an attribute query string
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
a set of <GFileQueryInfoFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an async enumerate children operation. See file:enumerate-children-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileEnumerator>.
a <GFileEnumerator> or #f if an
error occurred. Free the returned object with object:unref.
Checks if the two given GFiles refer to the same file.
This function can be used with file:hash to
insert <GFile>s efficiently in a hash table.
Note that two GFiles that differ can still refer to the same file
on the filesystem due to various forms of filename aliasing. For local
files, this function essentially compares the file paths, so two
<GFile>s which point to different hard or soft links
will not be considered equal, despite pointing to the same content.
For determining whether two files are hardlinked, see
Gio.FILE_ATTRIBUTE_ID_FILE.
This call does no blocking I/O.
Gets a <GMount> for the <GFile>.
<GMount> is returned only for user interesting
locations, see <GVolumeMonitor>. If the
GFileIface for self does not have a mount,
error will be set to not-found and
#f will be returned.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GMount>.
a <GMount> where the self is located or
#f on error. Free the returned object with object:unref.
Asynchronously gets the mount for the file.
For more details, see file:find-enclosing-mount which is the
synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:find-enclosing-mount-finish to get
the result of the operation.
Passed: a <GFile>.
a <GFile>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous find mount request. See file:find-enclosing-mount-async.
Passed: a <GFile>.
a <GFile>
Passed: a <GAsyncResult>.
Returned: a <GMount>.
<GMount> for given self or #f on error.
Free the returned object with object:unref.
Gets the base name (the last component of the path) for a given
<GFile>.
If called for the top level of a system (such as the filesystem root or a uri like sftp://host/) it will return a single directory separator (and on Windows, possibly a drive letter).
The base name is a byte string (not UTF-8). It has no defined encoding
or rules other than it may not contain zero bytes. 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 file:query-info.
This call does no blocking I/O.
Passed: a <GFile>.
input <GFile>
Returned: a file name, as a string, or #f.
string containing the <GFile>’s base name, or
#f if given <GFile> is invalid. The returned
string should be freed with byte-array:free when
no longer needed.
Gets a child of self with basename equal to name.
Note that the file with that specific name might not exist, but you can
still have a <GFile> that points to it. You can use
this for instance to create that file.
This call does no blocking I/O.
Passed: a <GFile>.
input <GFile>
Passed: a file name, as a string.
string containing the child’s basename
Returned: a <GFile>.
a <GFile> to a child specified by name. Free
the returned object with object:unref.
Gets the child of self for a given display-name (i.e. a
UTF-8 version of the name). If this function fails, it returns
#f 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.
This call does no blocking I/O.
Passed: a <GFile>.
input <GFile>
Passed: a string.
string to a possible child
Returned: a <GFile>.
a <GFile> to the specified child, or #f if the
display name couldn’t be converted. Free the returned object with
object:unref.
Gets the parent directory for the self. If the self
represents the root directory of the file system, then #f will be
returned.
This call does no blocking I/O.
Gets the parse name of the self. A parse name is a UTF-8 string
that describes the file such that one can get the
<GFile> back using
file-parse-name.
This is generally used to show the <GFile> as a nice
full-pathname kind of string in a user interface, like in a location
entry.
For local files with names that can safely be converted to UTF-8 the pathname is used, otherwise the IRI is used (a form of URI that allows UTF-8 characters unescaped).
This call does no blocking I/O.
Passed: a <GFile>.
input <GFile>
Returned: a string.
a string containing the <GFile>’s parse name. The
returned string should be freed with
byte-array:free when no longer needed.
Gets the local pathname for <GFile>, if one exists.
If non-#f, this is guaranteed to be an absolute, canonical path.
It might contain symlinks.
This call does no blocking I/O.
Passed: a <GFile>.
input <GFile>
Returned: a file name, as a string, or #f.
string containing the <GFile>’s path, or #f if
no such path exists. The returned string should be freed with
byte-array:free when no longer needed.
Gets the path for descendant relative to self.
This call does no blocking I/O.
Passed: a <GFile>.
input <GFile>
Passed: a <GFile>.
input <GFile>
Returned: a file name, as a string, or #f.
string with the relative path from descendant to self, or
#f if descendant doesn’t have self as prefix. The
returned string should be freed with
byte-array:free when no longer needed.
Gets the URI for the self.
This call does no blocking I/O.
Passed: a <GFile>.
input <GFile>
Returned: a string.
a string containing the <GFile>’s URI. If the
<GFile> was constructed with an invalid URI, an
invalid URI is returned. The returned string should be freed with
byte-array:free when no longer needed.
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.
The scheme can be different from the one used to construct the
<GFile>, in that it might be replaced with one that
is logically equivalent to the <GFile>.
This call does no blocking I/O.
Passed: a <GFile>.
input <GFile>
Returned: a string, or #f.
a string containing the URI scheme for the given
<GFile> or #f if the
<GFile> was constructed with an invalid URI. The
returned string should be freed with
byte-array:free when no longer needed.
Checks if self has a parent, and optionally, if it is parent.
If parent is #f then this function returns #t if
self has any parent at all. If parent is non-#f then
#t is only returned if self is an immediate child of
parent.
Checks whether self has the prefix specified by prefix.
In other words, if the names of initial elements of self’s pathname match prefix. Only full pathname elements are matched, so a path like /foo is not considered a prefix of /foobar, only of /foo/bar.
A <GFile> is not a prefix of itself. If you want to
check for equality, use file:equal?.
This call does no I/O, as it works purely on names. As such it can
sometimes return #f even if self is inside a prefix
(from a filesystem point of view), because the prefix of self is
an alias of prefix.
Checks to see if a <GFile> has a given URI scheme.
This call does no blocking I/O.
Creates a hash value for a <GFile>.
This call does no blocking I/O.
Passed: a <GFile>.
gconstpointer to a <GFile>
Returned: an unsigned 32-bit integer.
0 if self is not a valid <GFile>, otherwise an
integer that can be used as hash value for the
<GFile>. This function is intended for easily
hashing a <GFile> to add to a
<GHashTable> or similar data structure.
Checks to see if a file is native to the platform.
A native file is one expressed in the platform-native filename format, e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local, as it might be on a locally mounted remote filesystem.
On some systems non-native files may be available using the native
filesystem via a userspace filesystem (FUSE), in these cases this call
will return #f, but file:get-path
will still return a native path.
This call does no blocking I/O.
Loads the contents of self and returns it as
<GBytes>.
If self is a resource:// based URI, the resulting bytes will
reference the embedded resource instead of a copy. Otherwise, this is
equivalent to calling file:load-contents and bytes:new-take.
For resources, etag-out will be set to #f.
The data contained in the resulting <GBytes> is
always zero-terminated, but this is not included in the
<GBytes> length. The resulting
<GBytes> should be freed with bytes:unref when no longer in use.
Passed: a <GFile>.
a <GFile>
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable> or #f
Returned: a <GBytes>.
a <GBytes> or #f and error is set
Returned: a string, or #f.
a location to place the current entity tag for the file, or #f if
the entity tag is not needed
Asynchronously loads the contents of self as
<GBytes>.
If self is a resource:// based URI, the resulting bytes will
reference the embedded resource instead of a copy. Otherwise, this is
equivalent to calling file:load-contents-async and bytes:new-take.
callback should call file:load-bytes-finish to get the result of this
asynchronous operation.
See file:load-bytes for more information.
Passed: a <GFile>.
a <GFile>
Passed, or left out: a <GCancellable>, or
#f.
a <GCancellable> or #f
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Completes an asynchronous request to file:load-bytes-async.
For resources, etag-out will be set to #f.
The data contained in the resulting <GBytes> is
always zero-terminated, but this is not included in the
<GBytes> length. The resulting
<GBytes> should be freed with bytes:unref when no longer in use.
See file:load-bytes for more information.
Passed: a <GFile>.
a <GFile>
Passed: a <GAsyncResult>.
a <GAsyncResult> provided to the callback
Returned: a <GBytes>.
a <GBytes> or #f and error is set
Returned: a string, or #f.
a location to place the current entity tag for the file, or #f if
the entity tag is not needed
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
byte-array:free when no longer needed.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the self’s contents were successfully loaded.
#f if there were errors.
Returned: a bytevector.
a location to place the contents of the file
Returned: a string, or #f.
a location to place the current entity tag for the file, or #f if
the entity tag is not needed
Not returned: it is the length of contents.
a location to place the length of the contents of the file, or #f
if the length is not needed
Starts an asynchronous load of the self’s contents.
For more details, see file:load-contents which is the synchronous version of
this call.
When the load operation has completed, callback will be called
with user data. To finish the operation, call file:load-contents-finish with the
<GAsyncResult> returned by the callback.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous load of the self’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 byte-array:free when no longer needed. If
etag-out is present, it will be set to the new entity tag for the
self.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the load was successful. If #f and error is
present, it will be set appropriately.
Returned: a bytevector.
a location to place the contents of the file
Returned: a string, or #f.
a location to place the current entity tag for the file, or #f if
the entity tag is not needed
Not returned: it is the length of contents.
a location to place the length of the contents of the file, or #f
if the length is not needed
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
byte-array:free when no longer needed.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the load was successful. If #f and error is
present, it will be set appropriately.
Returned: a bytevector.
a location to place the contents of the file
Returned: a string, or #f.
a location to place the current entity tag for the file, or #f if
the entity tag is not needed
Not returned: it is the length of contents.
a location to place the length of the contents of the file, or #f
if the length is not needed
Asynchronously creates a directory.
Passed: a <GFile>.
input <GFile>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous directory creation, started with
file:make-directory-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t on successful directory creation, #f otherwise.
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
not-supported. If the directory itself
already exists, this function will fail setting error to
exists, unlike the similar
mkdir-with-parents.
For a local <GFile> the newly created directories
will have the default (current) ownership and permissions of the current
process.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if all directories have been successfully created, #f
otherwise.
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
file:make-directory-with-parents?.
This function will fail if the parent directory does not exist, setting
error to not-found. If the file system
doesn’t support creating directories, this function will fail, setting
error to not-supported. If the
directory already exists, Gio.IOErrorEnum.EXISTS will be
returned.
For a local <GFile> the newly created directory will
have the default (current) ownership and permissions of the current
process.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t on successful creation, #f otherwise.
Asynchronously creates a symbolic link named self which contains the string symlink-value.
Passed: a <GFile>.
a <GFile> with the name of the symlink to create
Passed: a file name, as a string.
a string with the path for the target of the new symlink
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous symbolic link creation, started with
file:make-symbolic-link-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t on successful directory creation, #f otherwise.
Creates a symbolic link named self which contains the string symlink-value.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
a <GFile> with the name of the symlink to create
Passed: a file name, as a string.
a string with the path for the target of the new symlink
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t on the creation of a new symlink, #f otherwise.
Recursively measures the disk usage of self.
This is essentially an analog of the ’du’ command, but it also reports the number of directories and non-directory files encountered (including things like symbolic links).
By default, errors are only reported against the toplevel file itself.
Errors found while recursing are silently ignored, unless
report-any-error is given in flags.
The returned size, disk-usage, is in bytes and should be formatted
with format-size in order to get
something reasonable for showing in a user interface.
progress-callback and progress-data can be given to request
periodic progress updates while scanning. See the documentation for
GFileMeasureProgressCallback
for information about when and how the callback will be invoked.
Passed: a <GFile>.
a <GFile>
Passed: a <GFileMeasureFlags>, or a list
of its symbols, or one of them.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable>
Passed, or left out: a procedure, or #f.
a GFileMeasureProgressCallback
See
GFileMeasureProgressCallback
for how it is called.
Returned: a boolean.
#t if successful, with the out parameters set. #f
otherwise, with error set.
Returned: an unsigned 64-bit integer.
the number of bytes of disk space used
Returned: an unsigned 64-bit integer.
the number of directories encountered
Returned: an unsigned 64-bit integer.
the number of non-directories encountered
Not passed: guile-gi supplies it.
user_data for progress-callback
Collects the results from an earlier call to
g_file_measure_disk_usage_async(). See file:measure-disk-usage for more information.
Passed: a <GFile>.
a <GFile>
Passed: a <GAsyncResult>.
the <GAsyncResult> passed to your
GAsyncReadyCallback
Returned: a boolean.
#t if successful, with the out parameters set. #f
otherwise, with error set.
Returned: an unsigned 64-bit integer.
the number of bytes of disk space used
Returned: an unsigned 64-bit integer.
the number of directories encountered
Returned: an unsigned 64-bit integer.
the number of non-directories encountered
Obtains a file or directory monitor for the given file, depending on the type of the file.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileMonitorFlags>, or a list
of its symbols, or one of them.
a set of <GFileMonitorFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileMonitor>.
a <GFileMonitor> for the given self, or
#f on error. Free the returned object with object:unref.
Obtains a directory monitor for the given file. This may fail if directory monitoring is not supported.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
It does not make sense for flags to contain
watch-hard-links, since hard links can
not be made to directories. It is not possible to monitor all the files
in a directory for changes made via hard links; if you want to do this
then you must register individual watches with file:monitor.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileMonitorFlags>, or a list
of its symbols, or one of them.
a set of <GFileMonitorFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileMonitor>.
a <GFileMonitor> for the given self, or
#f on error. Free the returned object with object:unref.
Obtains a file monitor for the given file. If no file notification mechanism exists, then regular polling of the file is used.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If flags contains watch-hard-links
then the monitor will also attempt to report changes made to the file
via another filename (ie, a hard link). Without this flag, you can only
rely on changes made through the filename contained in self to be
reported. Using this flag may result in an increase in resource usage,
and may not have any effect depending on the
<GFileMonitor> backend and/or filesystem type.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileMonitorFlags>, or a list
of its symbols, or one of them.
a set of <GFileMonitorFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileMonitor>.
a <GFileMonitor> for the given self, or
#f on error. Free the returned object with object:unref.
Starts a mount-operation, mounting the volume that contains the file self.
When this operation has completed, callback will be called with
user-user data, and the operation can be finalized with
file:mount-enclosing-volume-finish?.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountMountFlags>, or a list of
its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GMountOperation>,
or #f.
a <GMountOperation> or #f to avoid
user interaction
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied, or #f
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes a mount operation started by file:mount-enclosing-volume.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if successful. If an error has occurred, this function will
return #f and set error appropriately if present.
Mounts a file of type G_FILE_TYPE_MOUNTABLE. Using mount-operation, you can request callbacks when, for instance, passwords are needed during authentication.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
When the operation is finished, callback will be called. You can
then call file:mount-mountable-finish to get the result
of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountMountFlags>, or a list of
its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GMountOperation>,
or #f.
a <GMountOperation>, or #f to avoid
user interaction
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes a mount operation. See file:mount-mountable for details.
Finish an asynchronous mount operation that was started with
file:mount-mountable.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFile>.
a <GFile> or #f on error. Free the returned
object with object:unref.
Asynchronously moves a file self to the location of
destination. For details of the behaviour, see file:move?.
If progress-callback is not #f, then that function that
will be called just like in file:move?. The
callback will run in the default main context of the thread calling
file:move-async — the same context as
callback is run in.
When the operation is finished, callback will be called. You can
then call file:move-finish? to get the
result of the operation.
Passed: a <GFile>.
<GFile> pointing to the source location
Passed: a <GFile>.
<GFile> pointing to the destination location
Passed: a <GFileCopyFlags>, or a list of its
symbols, or one of them.
set of <GFileCopyFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed: a <GCancellable>, or #f.
optional <GCancellable> object, #f to
ignore
Passed: a <GClosure>, or #f.
Passed: a <GClosure>.
GFileProgressCallback function for
updates
See GFileProgressCallback for how it
is called.
gpointer to user data for the callback function
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
the data to pass to callback function
Finishes an asynchronous file movement, started with file:move-async.
Passed: a <GFile>.
input source <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t on successful file move, #f otherwise.
Tries to move the file or directory self 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.
If the flag overwrite is specified an
already existing destination file is overwritten.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If progress-callback is not #f, then the operation can be
monitored by setting this to a
GFileProgressCallback function.
progress-callback-data will be passed to this function. It is
guaranteed that this callback will be called after all data has been
transferred with the total number of bytes copied during the operation.
If the self file does not exist, then the
not-found error is returned, independent on
the status of the destination.
If overwrite is not specified and the target
exists, then the error exists is returned.
If trying to overwrite a file over a directory, the
is-directory error is returned. If trying to
overwrite a directory with a directory the
would-merge error is returned.
If the source is a directory and the target does not exist, or
overwrite is specified and the target is a
file, then the would-recurse error may be
returned (if the native move operation isn’t available).
Passed: a <GFile>.
<GFile> pointing to the source location
Passed: a <GFile>.
<GFile> pointing to the destination location
Passed: a <GFileCopyFlags>, or a list of its
symbols, or one of them.
set of <GFileCopyFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
GFileProgressCallback function for
updates
See GFileProgressCallback for how it
is called.
Returned: a boolean.
#t on successful move, #f otherwise.
Not passed: guile-gi supplies it.
gpointer to user data for the callback function
Constructs a <GFile> from a vector of elements using
the correct separator for filenames.
Using this function is equivalent to calling
build-filenamev, followed by
file-new-for-path on the result.
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.
Note that on Windows, this function expects its argument to be in UTF-8
– not the system code page. This means that you should not use this
function with string from argv as it is passed to main().
g_win32_get_command_line() will return a UTF-8 version of the
commandline. <GApplication> also uses UTF-8
but application-command-line:create-file-for-arg may
be more useful for you there. It is also always possible to use this
function with GOptionContext arguments of type
filename.
Passed: a file name, as a string.
a command line string
Returned: a <GFile>.
a new <GFile>. Free the returned object with
object:unref.
Creates a <GFile> with the given argument from the
command line.
This function is similar to
file-new-for-commandline-arg
except that it allows for passing the current working directory as an
argument instead of using the current working directory of the process.
This is useful if the commandline argument was given in a context other than the invocation of the current process.
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.
Passed: a file name, as a string.
a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
Returned: a <GFile>.
a new <GFile> for the given path. Free the
returned object with object:unref.
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.
Passed: a string.
a UTF-8 string containing a URI
Returned: a <GFile>.
a new <GFile> for the given uri. Free the
returned object with object:unref.
Opens a file in the preferred directory for temporary files (as returned
by get-tmp-dir) and returns a
<GFile> and
<GFileIOStream> pointing to it.
tmpl should be a string in the GLib file name encoding containing
a sequence of six ’X’ characters, and containing no directory
components. If it is #f, a default template is used.
Unlike the other <GFile> constructors, this will
return #f if a temporary file could not be created.
Passed, or left out: a file name, as a string, or #f.
Template for the file name, as in
file-open-tmp, or #f for a
default template
Returned: a <GFile>.
a new <GFile>. Free the returned object with
object:unref.
Returned: a <GFileIOStream>.
on return, a <GFileIOStream> for the created
file
Asynchronously opens a file in the preferred directory for temporary
files (as returned by get-tmp-dir) as
file-new-tmp.
tmpl should be a string in the GLib file name encoding containing
a sequence of six ’X’ characters, and containing no directory
components. If it is #f, a default template is used.
Passed: a file name, as a string, or #f.
Template for the file name, as in
file-open-tmp, or #f for a
default template
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is done
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
data to pass to callback
Asynchronously creates a directory in the preferred directory for
temporary files (as returned by
get-tmp-dir) as
dir-make-tmp.
tmpl should be a string in the GLib file name encoding containing
a sequence of six ’X’ characters, and containing no directory
components. If it is #f, a default template is used.
Passed: a file name, as a string, or #f.
Template for the file name, as in
dir-make-tmp, or #f for a default
template
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is done
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
data to pass to callback
Finishes a temporary directory creation started by
file-new-tmp-dir-async.
Passed: a <GAsyncResult>.
Returned: a <GFile>.
a new <GFile>. Free the returned object with
object:unref.
Finishes a temporary file creation started by
file-new-tmp-async.
Passed: a <GAsyncResult>.
Returned: a <GFile>.
a new <GFile>. Free the returned object with
object:unref.
Returned: a <GFileIOStream>.
on return, a <GFileIOStream> for the created
file
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.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If the file does not exist, the not-found
error will be returned. If the file is a directory, the
is-directory error will be returned. Other
errors are possible too, and depend on what kind of filesystem the file
is on. Note that in many non-local file cases read and write streams
are not supported, so make sure you really need to do read and write
streaming, rather than just opening for reading or writing.
Passed: a <GFile>.
<GFile> to open
Passed, or left out: a <GCancellable>, or
#f.
Returned: a <GFileIOStream>.
<GFileIOStream> or #f on error. Free
the returned object with object:unref.
Asynchronously opens self for reading and writing.
For more details, see file:open-readwrite which is the synchronous version
of this call.
When the operation is finished, callback will be called. You can
then call file:open-readwrite-finish to get the result of
the operation.
Passed: a <GFile>.
input <GFile>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file read operation started with
file:open-readwrite-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileIOStream>.
a <GFileIOStream> or #f on error. Free
the returned object with object:unref.
Constructs a <GFile> with the given parse-name
(i.e. something given by 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.
Exactly like 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.
This call does no blocking I/O.
Polls a file of type mountable.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
When the operation is finished, callback will be called. You can
then call file:mount-mountable-finish to get the result
of the operation.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied, or #f
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes a poll operation. See file:poll-mountable for details.
Finish an asynchronous poll operation that was polled with
file:poll-mountable.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the operation finished successfully. #f otherwise.
Returns the <GAppInfo> that is registered as the
default application to handle the file specified by self.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
a <GFile> to open
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GAppInfo>.
a <GAppInfo> if the handle was found, #f if
there were errors. When you are done with it, release it with
object:unref
Async version of file:query-default-handler.
Passed: a <GFile>.
a <GFile> to open
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is done
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
data to pass to callback
Finishes a file:query-default-handler-async
operation.
Passed: a <GFile>.
a <GFile> to open
Passed: a <GAsyncResult>.
Returned: a <GAppInfo>.
a <GAppInfo> if the handle was found, #f if
there were errors. When you are done with it, release it with
object:unref
Utility function to check if a particular file exists.
The fallback implementation of this API is using file:query-info and therefore may do blocking I/O. To
asynchronously query the existence of a file, use file:query-info-async.
Note that in many cases it is racy to first check for file existence and then execute something based on the outcome of that, because the file might have been created or removed in between the operations. The general approach to handling that is to not check, but just do the operation and handle the errors as they come.
As an example of race-free checking, take the case of reading a file,
and if it doesn’t exist, creating it. There are two racy versions: read
it, and on error create it; and: check if it exists, if not create it.
These can both result in two processes creating the file (with perhaps a
partially written file as the result). The correct approach is to
always try to create the file with file:create
which will either atomically create the file or fail with a
exists error.
However, in many cases an existence check is useful in a user interface, for instance to make a menu item sensitive/insensitive, so that you don’t have to fool users that something is possible and then just show an error dialog. If you do this, you should make sure to also handle the errors that can happen due to races when you execute the operation.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the file exists (and can be detected without error),
#f otherwise (or if cancelled).
Utility function to inspect the <GFileType> of a
file. This is implemented using file:query-info and as such does blocking I/O.
The primary use case of this method is to check if a file is a regular file, directory, or symlink.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
a set of <GFileQueryInfoFlags> passed
to file:query-info
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileType>.
The <GFileType> of the file and
unknown if the file does not exist
Similar to file:query-info, but obtains
information about the filesystem the self is on, rather than the
file itself. For instance the amount of space available and the type of
the filesystem.
The attributes value is a string that specifies the attributes
that should be gathered. It is not an error if it’s not possible to
read a particular requested attribute from a file - it just won’t be
set. attributes should be a comma-separated list of attributes or
attribute wildcards. The wildcard "\*" means all attributes, and a
wildcard like "filesystem::*" means all attributes in the filesystem
namespace. The standard namespace for filesystem attributes is
"filesystem". Common attributes of interest are
G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the
filesystem in bytes), G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of
bytes available), and G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of
the filesystem).
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If the file does not exist, the not-found
error will be returned. Other errors are possible too, and depend on
what kind of filesystem the file is on.
Passed: a <GFile>.
input <GFile>
Passed: a string.
an attribute query string
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileInfo>.
a <GFileInfo> or #f if there was an error.
Free the returned object with object:unref.
Asynchronously gets the requested information about the filesystem that
the specified self is on. The result is a
<GFileInfo> object that contains key-value
attributes (such as type or size for the file).
For more details, see file:query-filesystem-info which is the
synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:query-info-finish to
get the result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a string.
an attribute query string
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous filesystem info query. See file:query-filesystem-info-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileInfo>.
<GFileInfo> for given self or #f on
error. Free the returned object with object:unref.
Gets the requested information about specified self.
The result is a <GFileInfo> object that contains
key-value attributes (such as the type or size of the file).
The attributes value is a string that specifies the file
attributes that should be gathered. It is not an error if it’s not
possible to read a particular requested attribute from a file — it just
won’t be set. In particular this means that if a file is inaccessible
(due to being in a folder with restrictive permissions), for example,
you can expect the returned <GFileInfo> to have
very few attributes set. You should check whether an attribute is set
using file-info:has-attribute?
before trying to retrieve its value.
It is guaranteed that if any of the following attributes are listed in
attributes, they will always be set in the returned
<GFileInfo>, even if the user doesn’t have
permissions to access the file:
Gio.FILE_ATTRIBUTE_STANDARD_NAME
Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
attributes should be a comma-separated list of attributes or
attribute wildcards. The wildcard "\*" means all attributes, and
a wildcard like "standard::*" means all attributes in the
standard namespace. An example attribute query might be
"standard::*,owner::user". The standard attributes are available
as defines, like Gio.FILE_ATTRIBUTE_STANDARD_NAME.
If cancellable is not NULL, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error Gio.IOErrorEnum.CANCELLED
will be returned.
For symlinks, normally the information about the target of the symlink
is returned, rather than information about the symlink itself. However
if you pass Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS in
flags the information about the symlink itself will be returned.
Also, for symlinks that point to non-existing files the information
about the symlink itself will be returned.
If the file does not exist, the Gio.IOErrorEnum.NOT_FOUND error
will be returned. Other errors are possible too, and depend on what
kind of file system the file is on.
Passed: a <GFile>.
input file
Passed: a string.
an attribute query string
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
flags to affect the query operation
Passed, or left out: a <GCancellable>, or
#f.
optional cancellable object
Returned: a <GFileInfo>.
a <GFileInfo> for the given self
Asynchronously gets the requested information about specified
self. The result is a <GFileInfo> object
that contains key-value attributes (such as type or size for the file).
For more details, see file:query-info
which is the synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:query-info-finish to
get the result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a string.
an attribute query string
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
a set of <GFileQueryInfoFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file info query. See file:query-info-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileInfo>.
<GFileInfo> for given self or #f on
error. Free the returned object with object:unref.
Obtain the list of settable attributes for the file.
Returns the type and full attribute name of all the attributes that can be set on this file. This doesn’t mean setting it will always succeed though, you might get an access failure, or some specific file may not support a specific attribute.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a
<GFileAttributeInfoList>.
a <GFileAttributeInfoList>
describing the settable attributes. When you are done with it, release
it with file-attribute-info-list:unref
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).
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a
<GFileAttributeInfoList>.
a <GFileAttributeInfoList>
describing the writable namespaces. When you are done with it, release
it with file-attribute-info-list:unref
Opens a file for reading. The result is a
<GFileInputStream> that can be used to
read the contents of the file.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If the file does not exist, the not-found
error will be returned. If the file is a directory, the
is-directory error will be returned. Other
errors are possible too, and depend on what kind of filesystem the file
is on.
Passed: a <GFile>.
<GFile> to read
Passed, or left out: a <GCancellable>, or
#f.
Returned: a <GFileInputStream>.
<GFileInputStream> or #f on error.
Free the returned object with object:unref.
Asynchronously opens self for reading.
For more details, see file:read which is the
synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:read-finish to get the
result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file read operation started with
file:read-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileInputStream>.
a <GFileInputStream> or #f on
error. Free the returned object with object:unref.
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.
This will try to replace the file in the safest way possible so that any errors during the writing will not affect an already existing copy of the file. For instance, for local files it may write to a temporary file and then atomically rename over the destination when the stream is closed.
By default files created are generally readable by everyone, but if you
pass private in flags the file will
be made readable only to the current user, to the level that is
supported on the target filesystem.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If you pass in a non-#f etag value and self already
exists, then this value is compared to the current entity tag of the
file, and if they differ an wrong-etag error
is returned. This generally means that the file has been changed since
you last read it. You can get the new etag from
file-output-stream:get-etag
after you’ve finished writing and closed the
<GFileOutputStream>. When you load a new
file you can use file-input-stream:query-info to get the etag of the file.
If make-backup is #t, this function will attempt to make a
backup of the current file before overwriting it. If this fails a
cant-create-backup error will be returned. If
you want to replace anyway, try again with make-backup set to
#f.
If the file is a directory the is-directory
error will be returned, and if the file is some other form of
non-regular file then a not-regular-file error
will be returned. Some file systems don’t allow all file names, and may
return an invalid-filename error, and if the
name is to long filename-too-long will be
returned. Other errors are possible too, and depend on what kind of
filesystem the file is on.
Passed: a <GFile>.
input <GFile>
Passed: a string, or #f.
an optional entity tag for the current <GFile>, or
NULL to ignore
Passed: a boolean.
#t if a backup should be created
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileOutputStream>.
a <GFileOutputStream> or #f on
error. Free the returned object with object:unref.
Asynchronously overwrites the file, replacing the contents, possibly creating a backup copy of the file first.
For more details, see file:replace which is
the synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:replace-finish to get
the result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a string, or #f.
an entity tag for the current <GFile>, or #f
to ignore
Passed: a boolean.
#t if a backup should be created
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Replaces the contents of self with contents of length bytes.
If etag is specified (not #f), any existing file must have
that etag, or the error wrong-etag will be
returned.
If make-backup is #t, this function will attempt to make a
backup of self. Internally, it uses file:replace, so will try to replace the file contents in the
safest way possible. For example, atomic renames are used when
replacing local files’ contents.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
The returned new-etag can be used to verify that the file hasn’t changed the next time it is saved over.
Passed: a <GFile>.
input <GFile>
Passed: a bytevector, or a list or vector, each an unsigned 8-bit integer.
a string containing the new contents for self
Passed: a string, or #f.
the old entity-tag for the document, or #f
Passed: a boolean.
#t if a backup should be created
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if successful. If an error has occurred, this function will
return #f and set error appropriately if present.
Returned: a string, or #f.
a location to a new entity tag for the document. This should be freed
with byte-array:free when no longer needed, or
#f
Not passed: guile-gi gives the length of contents.
the length of contents in bytes
Starts an asynchronous replacement of self with the given contents of length bytes. etag will replace the document’s current entity tag.
When this operation has completed, callback will be called with
user-user data, and the operation can be finalized with
file:replace-contents-finish.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If make-backup is #t, this function will attempt to make a
backup of self.
Note that no copy of contents will be made, so it must stay valid
until callback is called. See file:replace-contents-bytes-async for a
<GBytes> version that will automatically hold a
reference to the contents (without copying) for the duration of the
call.
Passed: a <GFile>.
input <GFile>
Passed: a bytevector, or a list or vector, each an unsigned 8-bit integer.
string of contents to replace the file with
Passed: a string, or #f.
a new entity tag for the self, or #f
Passed: a boolean.
#t if a backup should be created
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi gives the length of contents.
the length of contents in bytes
Not passed: guile-gi supplies it.
the data to pass to callback function
Same as file:replace-contents-async but takes a
<GBytes> input instead. This function will
keep a ref on contents until the operation is done. Unlike
file:replace-contents-async
this allows forgetting about the content without waiting for the
callback.
When this operation has completed, callback will be called with
user-user data, and the operation can be finalized with
file:replace-contents-finish.
Passed: a <GFile>.
input <GFile>
Passed: a <GBytes>.
a <GBytes>
Passed: a string, or #f.
a new entity tag for the self, or #f
Passed: a boolean.
#t if a backup should be created
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous replace of the given self. See
file:replace-contents-async.
Sets new-etag to the new entity tag for the document, if present.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t on success, #f on failure.
Returned: a string, or #f.
a location of a new entity tag for the document. This should be freed
with byte-array:free when it is no longer
needed, or #f
Finishes an asynchronous file replace operation started with
file:replace-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileOutputStream>.
a <GFileOutputStream>, or #f on
error. Free the returned object with object:unref.
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.
For details about the behaviour, see file:replace which does the same thing but returns an output
stream only.
Note that in many non-local file cases read and write streams are not supported, so make sure you really need to do read and write streaming, rather than just opening for reading or writing.
Passed: a <GFile>.
a <GFile>
Passed: a string, or #f.
an optional entity tag for the current <GFile>, or
NULL to ignore
Passed: a boolean.
#t if a backup should be created
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileIOStream>.
a <GFileIOStream> or #f on error. Free
the returned object with object:unref.
Asynchronously overwrites the file in read-write mode, replacing the contents, possibly creating a backup copy of the file first.
For more details, see file:replace-readwrite which is the synchronous
version of this call.
When the operation is finished, callback will be called. You can
then call file:replace-readwrite-finish to get the
result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a string, or #f.
an entity tag for the current <GFile>, or #f
to ignore
Passed: a boolean.
#t if a backup should be created
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file replace operation started with
file:replace-readwrite-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileIOStream>.
a <GFileIOStream>, or #f on error.
Free the returned object with object:unref.
Resolves a relative path for self to an absolute path.
This call does no blocking I/O.
If the relative-path is an absolute path name, the resolution is done absolutely (without taking self path as base).
Sets attribute of type byte-string
to value. If attribute is of a different type, this
operation will fail, returning #f.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string containing the attribute’s name
Passed: a string.
a string containing the attribute’s new value
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the attribute was successfully set to value in
the self, #f otherwise.
Sets attribute of type int32 to
value. If attribute is of a different type, this operation
will fail.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string containing the attribute’s name
Passed: a 32-bit integer.
a gint32 containing the attribute’s new value
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the attribute was successfully set to value in
the self, #f otherwise.
Sets attribute of type int64 to
value. If attribute is of a different type, this operation
will fail.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string containing the attribute’s name
Passed: a 64-bit integer.
a guint64 containing the attribute’s new value
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the attribute was successfully set, #f
otherwise.
Sets attribute of type string to
value. If attribute is of a different type, this operation
will fail.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string containing the attribute’s name
Passed: a string.
a string containing the attribute’s value
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the attribute was successfully set, #f
otherwise.
Sets attribute of type uint32 to
value. If attribute is of a different type, this operation
will fail.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string containing the attribute’s name
Passed: an unsigned 32-bit integer.
a guint32 containing the attribute’s new value
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the attribute was successfully set to value in
the self, #f otherwise.
Sets attribute of type uint64 to
value. If attribute is of a different type, this operation
will fail.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string containing the attribute’s name
Passed: an unsigned 64-bit integer.
a guint64 containing the attribute’s new value
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the attribute was successfully set to value in
the self, #f otherwise.
Sets an attribute in the file with attribute name attribute to value-p.
Some attributes can be unset by setting type to
invalid and value-p to #f.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string containing the attribute’s name
Passed: a <GFileAttributeType>, or one
of its symbols.
The type of the attribute
Passed: a foreign pointer, or a bytevector, or #f.
a pointer to the value (or the pointer itself if the type is a pointer type)
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
a set of <GFileQueryInfoFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the attribute was set, #f otherwise.
Asynchronously sets the attributes of self with info.
For more details, see file:set-attributes-from-info?, which is the
synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:set-attributes-finish to get the result of
the operation.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileInfo>.
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes setting an attribute started in file:set-attributes-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the attributes were set correctly, #f otherwise.
Returned: a <GFileInfo>.
Tries to set all attributes in the <GFileInfo> on
the target values, not stopping on the first error.
If there is any error during this operation then error will be set
to the first error. Error on particular fields are flagged by setting
the "status" field in the attribute value to
error-setting, which means you can
also detect further errors.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileInfo>.
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#f if there was any error, #t otherwise.
Renames self to the specified display name.
The display name is converted from UTF-8 to the correct encoding for the target filesystem if possible and the self is renamed to this.
If you want to implement a rename operation in the user interface the
edit name (G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as
the initial value in the rename widget, and then the result after
editing should be passed to file:set-display-name.
On success the resulting converted filename is returned.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFile>.
a <GFile> specifying what self was renamed to,
or #f if there was an error. Free the returned object with
object:unref.
Asynchronously sets the display name for a given
<GFile>.
For more details, see file:set-display-name which is the synchronous
version of this call.
When the operation is finished, callback will be called. You can
then call file:set-display-name-finish to get the
result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes setting a display name started with file:set-display-name-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFile>.
a <GFile> or #f on error. Free the returned
object with object:unref.
Starts a file of type mountable. Using
start-operation, you can request callbacks when, for instance,
passwords are needed during authentication.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
When the operation is finished, callback will be called. You can
then call file:mount-mountable-finish to get the result
of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a <GDriveStartFlags>, or a list of
its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GMountOperation>,
or #f.
a <GMountOperation>, or #f to avoid
user interaction
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied, or #f
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes a start operation. See file:start-mountable for details.
Finish an asynchronous start operation that was started with
file:start-mountable.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the operation finished successfully. #f otherwise.
Stops a file of type mountable.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
When the operation is finished, callback will be called. You can
then call file:stop-mountable-finish? to get the result
of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountUnmountFlags>, or a
list of its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GMountOperation>,
or #f.
a <GMountOperation>, or #f to avoid
user interaction.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied, or #f
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes a stop operation, see file:stop-mountable for details.
Finish an asynchronous stop operation that was started with
file:stop-mountable.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the operation finished successfully. #f otherwise.
Checks if self supports thread-default main contexts (see
main-context:push-thread-default) If this
returns #f, you cannot perform asynchronous operations on
self in a thread that has a thread-default context.
Asynchronously sends self to the Trash location, if possible.
Passed: a <GFile>.
input <GFile>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file trashing operation, started with
file:trash-async.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t on successful trash, #f otherwise.
Sends self 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 not-supported error. Since GLib 2.66, the
x-gvfs-notrash unix mount option can be used to disable
file:trash? support for particular mounts, the
not-supported error will be returned in that
case. Since 2.82, the x-gvfs-trash unix mount option can be used
to enable file:trash? support for particular
system mounts.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Passed: a <GFile>.
<GFile> to send to trash
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t on successful trash, #f otherwise.
Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
When the operation is finished, callback will be called. You can
then call file:unmount-mountable-finish? to get the
result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountUnmountFlags>, or a
list of its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an unmount operation, see file:unmount-mountable for details.
Finish an asynchronous unmount operation that was started with
file:unmount-mountable.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the operation finished successfully. #f otherwise.
Unmounts a file of type mountable.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
When the operation is finished, callback will be called. You can
then call file:unmount-mountable-finish? to get the
result of the operation.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountUnmountFlags>, or a
list of its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GMountOperation>,
or #f.
a <GMountOperation>, or #f to avoid
user interaction
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an unmount operation, see file:unmount-mountable-with-operation
for details.
Finish an asynchronous unmount operation that was started with
file:unmount-mountable-with-operation.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the operation finished successfully. #f otherwise.
Gets an output stream for appending data to the file. If the file doesn’t already exist it is created.
By default files created are generally readable by everyone, but if you
pass private in flags the file will
be made readable only to the current user, to the level that is
supported on the target filesystem.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
Some file systems don’t allow all file names, and may return an
invalid-filename error. If the file is a
directory the is-directory error will be
returned. Other errors are possible too, and depend on what kind of
filesystem the file is on.
To override it in a new class, give register-type #:vfuncs
`((append-to . ,procedure)). The procedure is called as
(procedure self flags cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileOutputStream>.
a <GFileOutputStream>, or #f on
error. Free the returned object with object:unref.
Asynchronously opens self for appending.
For more details, see file:append-to which
is the synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:append-to-finish to
get the result of the operation.
To override it in a new class, give register-type #:vfuncs
`((append-to-async . ,procedure)). The procedure is called as
(procedure self flags io-priority cancellable callback
user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file append operation started with
file:append-to-async.
To override it in a new class, give register-type #:vfuncs
`((append-to-finish . ,procedure)). The procedure is called as
(procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileOutputStream>.
a valid <GFileOutputStream> or #f
on error. Free the returned object with object:unref.
Copies the file self to the location specified by destination. Can not handle recursive copies of directories.
If the flag overwrite is specified an
already existing destination file is overwritten.
If the flag nofollow-symlinks is specified
then symlinks will be copied as symlinks, otherwise the target of the
self symlink will be copied.
If the flag all-metadata is specified then
all the metadata that is possible to copy is copied, not just the
default subset (which, for instance, does not include the owner, see
<GFileInfo>).
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If progress-callback is not #f, then the operation can be
monitored by setting this to a
GFileProgressCallback function.
progress-callback-data will be passed to this function. It is
guaranteed that this callback will be called after all data has been
transferred with the total number of bytes copied during the operation.
If the self file does not exist, then the
not-found error is returned, independent on
the status of the destination.
If overwrite is not specified and the target
exists, then the error exists is returned.
If trying to overwrite a file over a directory, the
is-directory error is returned. If trying to
overwrite a directory with a directory the
would-merge error is returned.
If the source is a directory and the target does not exist, or
overwrite is specified and the target is a
file, then the would-recurse error is
returned.
If you are interested in copying the <GFile> object
itself (not the on-disk file), see file:dup.
To override it in a new class, give register-type #:vfuncs
`((copy . ,procedure)). The procedure is called as (procedure
self destination flags cancellable progress-callback
progress-callback-data) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GFile>.
destination <GFile>
Passed: a <GFileCopyFlags>, or a list of its
symbols, or one of them.
set of <GFileCopyFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
function to callback with progress information, or #f if progress
information is not needed
See GFileProgressCallback for how it
is called.
Returned: a boolean.
#t on success, #f otherwise.
Not passed: guile-gi supplies it.
user data to pass to progress-callback
Copies the file self to the location specified by
destination asynchronously. For details of the behaviour, see
file:copy?.
If progress-callback is not #f, then that function that
will be called just like in file:copy?. The
callback will run in the default main context of the thread calling
file:copy-async — the same context as
callback is run in.
When the operation is finished, callback will be called. You can
then call file:copy-finish? to get the
result of the operation.
To override it in a new class, give register-type #:vfuncs
`((copy-async . ,procedure)). The procedure is called as
(procedure self destination flags io-priority cancellable
progress-callback progress-callback-data callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GFile>.
destination <GFile>
Passed: a <GFileCopyFlags>, or a list of its
symbols, or one of them.
set of <GFileCopyFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
function to callback with progress information, or #f if progress
information is not needed
See GFileProgressCallback for how it
is called.
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
user data to pass to progress-callback
Not passed: guile-gi supplies it.
the data to pass to callback
Finishes copying the file started with file:copy-async.
To override it in a new class, give register-type #:vfuncs
`((copy-finish . ,procedure)). The procedure is called as
(procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
a #t on success, #f on error.
Creates a new file and returns an output stream for writing to it. The file must not already exist.
By default files created are generally readable by everyone, but if you
pass private in flags the file will
be made readable only to the current user, to the level that is
supported on the target filesystem.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If a file or directory with this name already exists the
exists error will be returned. Some file
systems don’t allow all file names, and may return an
invalid-filename error, and if the name is to
long filename-too-long will be returned. Other
errors are possible too, and depend on what kind of filesystem the file
is on.
To override it in a new class, give register-type #:vfuncs
`((create . ,procedure)). The procedure is called as (procedure
self flags cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileOutputStream>.
a <GFileOutputStream> for the newly
created file, or #f on error. Free the returned object with
object:unref.
Asynchronously creates a new file and returns an output stream for writing to it. The file must not already exist.
For more details, see file:create which is the
synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:create-finish to get the
result of the operation.
To override it in a new class, give register-type #:vfuncs
`((create-async . ,procedure)). The procedure is called as
(procedure self flags io-priority cancellable callback
user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file create operation started with
file:create-async.
To override it in a new class, give register-type #:vfuncs
`((create-finish . ,procedure)). The procedure is called as
(procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileOutputStream>.
a <GFileOutputStream> or #f on
error. Free the returned object with object:unref.
Creates a new file and returns a stream for reading and writing to it. The file must not already exist.
By default files created are generally readable by everyone, but if you
pass private in flags the file will
be made readable only to the current user, to the level that is
supported on the target filesystem.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If a file or directory with this name already exists, the
exists error will be returned. Some file
systems don’t allow all file names, and may return an
invalid-filename error, and if the name is too
long, filename-too-long will be returned.
Other errors are possible too, and depend on what kind of filesystem the
file is on.
Note that in many non-local file cases read and write streams are not supported, so make sure you really need to do read and write streaming, rather than just opening for reading or writing.
To override it in a new class, give register-type #:vfuncs
`((create-readwrite . ,procedure)). The procedure is called as
(procedure self flags cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
a <GFile>
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileIOStream>.
a <GFileIOStream> for the newly created file,
or #f on error. Free the returned object with object:unref.
Asynchronously creates a new file and returns a stream for reading and writing to it. The file must not already exist.
For more details, see file:create-readwrite which is the synchronous
version of this call.
When the operation is finished, callback will be called. You can
then call file:create-readwrite-finish to get the
result of the operation.
To override it in a new class, give register-type #:vfuncs
`((create-readwrite-async . ,procedure)). The procedure is called as
(procedure self flags io-priority cancellable callback
user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file create operation started with
file:create-readwrite-async.
To override it in a new class, give register-type #:vfuncs
`((create-readwrite-finish . ,procedure)). The procedure is called as
(procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileIOStream>.
a <GFileIOStream> or #f on error. Free
the returned object with object:unref.
Deletes a file. If the self is a directory, it will only be
deleted if it is empty. This has the same semantics as
unlink.
If self doesn’t exist, not-found will be
returned. This allows for deletion to be implemented avoiding
time-of-check
to time-of-use races:
g_autoptr(GError) local_error = NULL;
if (!g_file_delete (my_file, my_cancellable, &local_error) &&
!g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
{
// deletion failed for some reason other than the file not existing:
// so report the error
g_warning ("Failed to delete %s: %s",
g_file_peek_path (my_file), local_error->message);
}
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((delete-file . ,procedure)). The procedure is called as
(procedure self cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the file was deleted. #f otherwise.
Asynchronously delete a file. If the self is a directory, it will
only be deleted if it is empty. This has the same semantics as
unlink.
To override it in a new class, give register-type #:vfuncs
`((delete-file-async . ,procedure)). The procedure is called as
(procedure self io-priority cancellable callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes deleting a file started with file:delete-async.
To override it in a new class, give register-type #:vfuncs
`((delete-file-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the file was deleted. #f otherwise.
Duplicates a <GFile> handle. This operation does not
duplicate the actual file or directory represented by the
<GFile>; see file:copy? if
attempting to copy a file.
file:dup is useful when a second handle is needed
to the same underlying file, for use in a separate thread
(<GFile> is not thread-safe). For use within the
same thread, use object:ref to
increment the existing object’s reference count.
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((dup . ,procedure)). The procedure is called as (procedure
self) ⇒ %return.
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 file:eject-mountable-finish?.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((eject-mountable . ,procedure)). The procedure is called as
(procedure self flags cancellable callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountUnmountFlags>, or a
list of its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous eject operation started by file:eject-mountable.
To override it in a new class, give register-type #:vfuncs
`((eject-mountable-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the self was ejected successfully. #f
otherwise.
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 file:eject-mountable-with-operation-finish?.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((eject-mountable-with-operation . ,procedure)). The procedure is
called as (procedure self flags mount-operation cancellable
callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountUnmountFlags>, or a
list of its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GMountOperation>,
or #f.
a <GMountOperation>, or #f to avoid
user interaction
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous eject operation started by file:eject-mountable-with-operation.
To override it in a new class, give register-type #:vfuncs
`((eject-mountable-with-operation-finish . ,procedure)). The
procedure is called as (procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the self was ejected successfully. #f
otherwise.
Gets the requested information about the files in a directory. The
result is a FileEnumerator object that will give out
FileInfo objects for all the files in the directory.
The attributes value is a string that specifies the file
attributes that should be gathered. It is not an error if it’s not
possible to read a particular requested attribute from a file - it just
won’t be set. attributes should be a comma-separated list of
attributes or attribute wildcards. The wildcard * means all
attributes, and a wildcard like "standard::*" means all
attributes in the standard namespace. An example attribute query be
"standard::*,owner::user". The standard attributes are available
as defines, like FILE_ATTRIBUTE_STANDARD_NAME.
FILE_ATTRIBUTE_STANDARD_NAME should always be specified if you
plan to call FileEnumerator.get_child or
FileEnumerator.iterate on the returned enumerator.
If cancellable is not NULL, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error Gio.IOErrorEnum.CANCELLED
will be returned.
If the file does not exist, the Gio.IOErrorEnum.NOT_FOUND error
will be returned. If the file is not a directory, the
Gio.IOErrorEnum.NOT_DIRECTORY error will be returned. Other
errors are possible too.
To override it in a new class, give register-type #:vfuncs
`((enumerate-children . ,procedure)). The procedure is called as
(procedure self attributes flags cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string.
an attribute query string
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
a set of <GFileQueryInfoFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileEnumerator>.
A <GFileEnumerator> if successful,
#f on error. Free the returned object with object:unref.
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.
For more details, see file:enumerate-children which is the synchronous
version of this call.
When the operation is finished, callback will be called. You can
then call file:enumerate-children-finish to get the
result of the operation.
To override it in a new class, give register-type #:vfuncs
`((enumerate-children-async . ,procedure)). The procedure is called
as (procedure self attributes flags io-priority cancellable
callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string.
an attribute query string
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
a set of <GFileQueryInfoFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an async enumerate children operation. See file:enumerate-children-async.
To override it in a new class, give register-type #:vfuncs
`((enumerate-children-finish . ,procedure)). The procedure is called
as (procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileEnumerator>.
a <GFileEnumerator> or #f if an
error occurred. Free the returned object with object:unref.
Checks if the two given GFiles refer to the same file.
This function can be used with file:hash to
insert <GFile>s efficiently in a hash table.
Note that two GFiles that differ can still refer to the same file
on the filesystem due to various forms of filename aliasing. For local
files, this function essentially compares the file paths, so two
<GFile>s which point to different hard or soft links
will not be considered equal, despite pointing to the same content.
For determining whether two files are hardlinked, see
Gio.FILE_ATTRIBUTE_ID_FILE.
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((equal . ,procedure)). The procedure is called as (procedure
self file2) ⇒ %return.
Gets a <GMount> for the <GFile>.
<GMount> is returned only for user interesting
locations, see <GVolumeMonitor>. If the
GFileIface for self does not have a mount,
error will be set to not-found and
#f will be returned.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((find-enclosing-mount . ,procedure)). The procedure is called as
(procedure self cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GMount>.
a <GMount> where the self is located or
#f on error. Free the returned object with object:unref.
Asynchronously gets the mount for the file.
For more details, see file:find-enclosing-mount which is the
synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:find-enclosing-mount-finish to get
the result of the operation.
To override it in a new class, give register-type #:vfuncs
`((find-enclosing-mount-async . ,procedure)). The procedure is called
as (procedure self io-priority cancellable callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
a <GFile>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous find mount request. See file:find-enclosing-mount-async.
To override it in a new class, give register-type #:vfuncs
`((find-enclosing-mount-finish . ,procedure)). The procedure is
called as (procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
a <GFile>
Passed: a <GAsyncResult>.
Returned: a <GMount>.
<GMount> for given self or #f on error.
Free the returned object with object:unref.
Gets the base name (the last component of the path) for a given
<GFile>.
If called for the top level of a system (such as the filesystem root or a uri like sftp://host/) it will return a single directory separator (and on Windows, possibly a drive letter).
The base name is a byte string (not UTF-8). It has no defined encoding
or rules other than it may not contain zero bytes. 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 file:query-info.
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((get-basename . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Returned: a file name, as a string, or #f.
string containing the <GFile>’s base name, or
#f if given <GFile> is invalid. The returned
string should be freed with byte-array:free when
no longer needed.
Gets the child of self for a given display-name (i.e. a
UTF-8 version of the name). If this function fails, it returns
#f 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.
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((get-child-for-display-name . ,procedure)). The procedure is called
as (procedure self display-name) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string.
string to a possible child
Returned: a <GFile>.
a <GFile> to the specified child, or #f if the
display name couldn’t be converted. Free the returned object with
object:unref.
Gets the parent directory for the self. If the self
represents the root directory of the file system, then #f will be
returned.
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((get-parent . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Returned: a <GFile>, or #f.
a <GFile> structure to the parent of the given
<GFile> or #f if there is no parent. Free the
returned object with object:unref.
Gets the parse name of the self. A parse name is a UTF-8 string
that describes the file such that one can get the
<GFile> back using
file-parse-name.
This is generally used to show the <GFile> as a nice
full-pathname kind of string in a user interface, like in a location
entry.
For local files with names that can safely be converted to UTF-8 the pathname is used, otherwise the IRI is used (a form of URI that allows UTF-8 characters unescaped).
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((get-parse-name . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Returned: a string.
a string containing the <GFile>’s parse name. The
returned string should be freed with
byte-array:free when no longer needed.
Gets the local pathname for <GFile>, if one exists.
If non-#f, this is guaranteed to be an absolute, canonical path.
It might contain symlinks.
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((get-path . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Returned: a file name, as a string, or #f.
string containing the <GFile>’s path, or #f if
no such path exists. The returned string should be freed with
byte-array:free when no longer needed.
Gets the path for descendant relative to self.
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((get-relative-path . ,procedure)). The procedure is called as
(procedure self descendant) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GFile>.
input <GFile>
Returned: a file name, as a string, or #f.
string with the relative path from descendant to self, or
#f if descendant doesn’t have self as prefix. The
returned string should be freed with
byte-array:free when no longer needed.
Gets the URI for the self.
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((get-uri . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Returned: a string.
a string containing the <GFile>’s URI. If the
<GFile> was constructed with an invalid URI, an
invalid URI is returned. The returned string should be freed with
byte-array:free when no longer needed.
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.
The scheme can be different from the one used to construct the
<GFile>, in that it might be replaced with one that
is logically equivalent to the <GFile>.
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((get-uri-scheme . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Returned: a string, or #f.
a string containing the URI scheme for the given
<GFile> or #f if the
<GFile> was constructed with an invalid URI. The
returned string should be freed with
byte-array:free when no longer needed.
Checks to see if a <GFile> has a given URI scheme.
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((has-uri-scheme . ,procedure)). The procedure is called as
(procedure self uri-scheme) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string containing a URI scheme
Returned: a boolean.
#t if <GFile>’s backend supports the given URI
scheme, #f if URI scheme is #f, not supported, or
<GFile> is invalid.
Creates a hash value for a <GFile>.
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((hash . ,procedure)). The procedure is called as (procedure
self) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
gconstpointer to a <GFile>
Returned: an unsigned 32-bit integer.
0 if self is not a valid <GFile>, otherwise an
integer that can be used as hash value for the
<GFile>. This function is intended for easily
hashing a <GFile> to add to a
<GHashTable> or similar data structure.
Checks to see if a file is native to the platform.
A native file is one expressed in the platform-native filename format, e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local, as it might be on a locally mounted remote filesystem.
On some systems non-native files may be available using the native
filesystem via a userspace filesystem (FUSE), in these cases this call
will return #f, but file:get-path
will still return a native path.
This call does no blocking I/O.
To override it in a new class, give register-type #:vfuncs
`((is-native . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
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
file:make-directory-with-parents?.
This function will fail if the parent directory does not exist, setting
error to not-found. If the file system
doesn’t support creating directories, this function will fail, setting
error to not-supported. If the
directory already exists, Gio.IOErrorEnum.EXISTS will be
returned.
For a local <GFile> the newly created directory will
have the default (current) ownership and permissions of the current
process.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((make-directory . ,procedure)). The procedure is called as
(procedure self cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t on successful creation, #f otherwise.
Asynchronously creates a directory.
To override it in a new class, give register-type #:vfuncs
`((make-directory-async . ,procedure)). The procedure is called as
(procedure self io-priority cancellable callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous directory creation, started with
file:make-directory-async.
To override it in a new class, give register-type #:vfuncs
`((make-directory-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t on successful directory creation, #f otherwise.
Creates a symbolic link named self which contains the string symlink-value.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((make-symbolic-link . ,procedure)). The procedure is called as
(procedure self symlink-value cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
a <GFile> with the name of the symlink to create
Passed: a file name, as a string.
a string with the path for the target of the new symlink
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t on the creation of a new symlink, #f otherwise.
Asynchronously creates a symbolic link named self which contains the string symlink-value.
To override it in a new class, give register-type #:vfuncs
`((make-symbolic-link-async . ,procedure)). The procedure is called
as (procedure self symlink-value io-priority cancellable callback
user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
a <GFile> with the name of the symlink to create
Passed: a file name, as a string.
a string with the path for the target of the new symlink
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous symbolic link creation, started with
file:make-symbolic-link-async.
To override it in a new class, give register-type #:vfuncs
`((make-symbolic-link-finish . ,procedure)). The procedure is called
as (procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t on successful directory creation, #f otherwise.
Recursively measures the disk usage of self.
This is essentially an analog of the ’du’ command, but it also reports the number of directories and non-directory files encountered (including things like symbolic links).
By default, errors are only reported against the toplevel file itself.
Errors found while recursing are silently ignored, unless
report-any-error is given in flags.
The returned size, disk-usage, is in bytes and should be formatted
with format-size in order to get
something reasonable for showing in a user interface.
progress-callback and progress-data can be given to request
periodic progress updates while scanning. See the documentation for
GFileMeasureProgressCallback
for information about when and how the callback will be invoked.
To override it in a new class, give register-type #:vfuncs
`((measure-disk-usage . ,procedure)). The procedure is called as
(procedure self flags cancellable progress-callback progress-data)
⇒ %return disk-usage num-dirs num-files.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
a <GFile>
Passed: a <GFileMeasureFlags>, or a list
of its symbols, or one of them.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable>
Passed, or left out: a procedure, or #f.
a GFileMeasureProgressCallback
See
GFileMeasureProgressCallback
for how it is called.
Returned: a boolean.
#t if successful, with the out parameters set. #f
otherwise, with error set.
Returned: an unsigned 64-bit integer.
the number of bytes of disk space used
Returned: an unsigned 64-bit integer.
the number of directories encountered
Returned: an unsigned 64-bit integer.
the number of non-directories encountered
Not passed: guile-gi supplies it.
user_data for progress-callback
Collects the results from an earlier call to
g_file_measure_disk_usage_async(). See file:measure-disk-usage for more information.
To override it in a new class, give register-type #:vfuncs
`((measure-disk-usage-finish . ,procedure)). The procedure is called
as (procedure self result) ⇒ %return disk-usage num-dirs
num-files.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
a <GFile>
Passed: a <GAsyncResult>.
the <GAsyncResult> passed to your
GAsyncReadyCallback
Returned: a boolean.
#t if successful, with the out parameters set. #f
otherwise, with error set.
Returned: an unsigned 64-bit integer.
the number of bytes of disk space used
Returned: an unsigned 64-bit integer.
the number of directories encountered
Returned: an unsigned 64-bit integer.
the number of non-directories encountered
Obtains a directory monitor for the given file. This may fail if directory monitoring is not supported.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
It does not make sense for flags to contain
watch-hard-links, since hard links can
not be made to directories. It is not possible to monitor all the files
in a directory for changes made via hard links; if you want to do this
then you must register individual watches with file:monitor.
To override it in a new class, give register-type #:vfuncs
`((monitor-dir . ,procedure)). The procedure is called as
(procedure self flags cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileMonitorFlags>, or a list
of its symbols, or one of them.
a set of <GFileMonitorFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileMonitor>.
a <GFileMonitor> for the given self, or
#f on error. Free the returned object with object:unref.
Obtains a file monitor for the given file. If no file notification mechanism exists, then regular polling of the file is used.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If flags contains watch-hard-links
then the monitor will also attempt to report changes made to the file
via another filename (ie, a hard link). Without this flag, you can only
rely on changes made through the filename contained in self to be
reported. Using this flag may result in an increase in resource usage,
and may not have any effect depending on the
<GFileMonitor> backend and/or filesystem type.
To override it in a new class, give register-type #:vfuncs
`((monitor-file . ,procedure)). The procedure is called as
(procedure self flags cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileMonitorFlags>, or a list
of its symbols, or one of them.
a set of <GFileMonitorFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileMonitor>.
a <GFileMonitor> for the given self, or
#f on error. Free the returned object with object:unref.
Starts a mount-operation, mounting the volume that contains the file self.
When this operation has completed, callback will be called with
user-user data, and the operation can be finalized with
file:mount-enclosing-volume-finish?.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((mount-enclosing-volume . ,procedure)). The procedure is called as
(procedure self flags mount-operation cancellable callback
user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountMountFlags>, or a list of
its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GMountOperation>,
or #f.
a <GMountOperation> or #f to avoid
user interaction
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied, or #f
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes a mount operation started by file:mount-enclosing-volume.
To override it in a new class, give register-type #:vfuncs
`((mount-enclosing-volume-finish . ,procedure)). The procedure is
called as (procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if successful. If an error has occurred, this function will
return #f and set error appropriately if present.
Mounts a file of type G_FILE_TYPE_MOUNTABLE. Using mount-operation, you can request callbacks when, for instance, passwords are needed during authentication.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
When the operation is finished, callback will be called. You can
then call file:mount-mountable-finish to get the result
of the operation.
To override it in a new class, give register-type #:vfuncs
`((mount-mountable . ,procedure)). The procedure is called as
(procedure self flags mount-operation cancellable callback
user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountMountFlags>, or a list of
its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GMountOperation>,
or #f.
a <GMountOperation>, or #f to avoid
user interaction
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes a mount operation. See file:mount-mountable for details.
Finish an asynchronous mount operation that was started with
file:mount-mountable.
To override it in a new class, give register-type #:vfuncs
`((mount-mountable-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFile>.
a <GFile> or #f on error. Free the returned
object with object:unref.
Tries to move the file or directory self 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.
If the flag overwrite is specified an
already existing destination file is overwritten.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If progress-callback is not #f, then the operation can be
monitored by setting this to a
GFileProgressCallback function.
progress-callback-data will be passed to this function. It is
guaranteed that this callback will be called after all data has been
transferred with the total number of bytes copied during the operation.
If the self file does not exist, then the
not-found error is returned, independent on
the status of the destination.
If overwrite is not specified and the target
exists, then the error exists is returned.
If trying to overwrite a file over a directory, the
is-directory error is returned. If trying to
overwrite a directory with a directory the
would-merge error is returned.
If the source is a directory and the target does not exist, or
overwrite is specified and the target is a
file, then the would-recurse error may be
returned (if the native move operation isn’t available).
To override it in a new class, give register-type #:vfuncs
`((move . ,procedure)). The procedure is called as (procedure
self destination flags cancellable progress-callback
progress-callback-data) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
<GFile> pointing to the source location
Passed: a <GFile>.
<GFile> pointing to the destination location
Passed: a <GFileCopyFlags>, or a list of its
symbols, or one of them.
set of <GFileCopyFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
GFileProgressCallback function for
updates
See GFileProgressCallback for how it
is called.
Returned: a boolean.
#t on successful move, #f otherwise.
Not passed: guile-gi supplies it.
gpointer to user data for the callback function
Asynchronously moves a file self to the location of
destination. For details of the behaviour, see file:move?.
If progress-callback is not #f, then that function that
will be called just like in file:move?. The
callback will run in the default main context of the thread calling
file:move-async — the same context as
callback is run in.
When the operation is finished, callback will be called. You can
then call file:move-finish? to get the
result of the operation.
To override it in a new class, give register-type #:vfuncs
`((move-async . ,procedure)). The procedure is called as
(procedure self destination flags io-priority cancellable
progress-callback progress-callback-data callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
<GFile> pointing to the source location
Passed: a <GFile>.
<GFile> pointing to the destination location
Passed: a <GFileCopyFlags>, or a list of its
symbols, or one of them.
set of <GFileCopyFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
GFileProgressCallback function for
updates
See GFileProgressCallback for how it
is called.
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
gpointer to user data for the callback function
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file movement, started with file:move-async.
To override it in a new class, give register-type #:vfuncs
`((move-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input source <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t on successful file move, #f otherwise.
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.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If the file does not exist, the not-found
error will be returned. If the file is a directory, the
is-directory error will be returned. Other
errors are possible too, and depend on what kind of filesystem the file
is on. Note that in many non-local file cases read and write streams
are not supported, so make sure you really need to do read and write
streaming, rather than just opening for reading or writing.
To override it in a new class, give register-type #:vfuncs
`((open-readwrite . ,procedure)). The procedure is called as
(procedure self cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
<GFile> to open
Passed, or left out: a <GCancellable>, or
#f.
Returned: a <GFileIOStream>.
<GFileIOStream> or #f on error. Free
the returned object with object:unref.
Asynchronously opens self for reading and writing.
For more details, see file:open-readwrite which is the synchronous version
of this call.
When the operation is finished, callback will be called. You can
then call file:open-readwrite-finish to get the result of
the operation.
To override it in a new class, give register-type #:vfuncs
`((open-readwrite-async . ,procedure)). The procedure is called as
(procedure self io-priority cancellable callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file read operation started with
file:open-readwrite-async.
To override it in a new class, give register-type #:vfuncs
`((open-readwrite-finish . ,procedure)). The procedure is called as
(procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileIOStream>.
a <GFileIOStream> or #f on error. Free
the returned object with object:unref.
Polls a file of type mountable.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
When the operation is finished, callback will be called. You can
then call file:mount-mountable-finish to get the result
of the operation.
To override it in a new class, give register-type #:vfuncs
`((poll-mountable . ,procedure)). The procedure is called as
(procedure self cancellable callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied, or #f
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes a poll operation. See file:poll-mountable for details.
Finish an asynchronous poll operation that was polled with
file:poll-mountable.
To override it in a new class, give register-type #:vfuncs
`((poll-mountable-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the operation finished successfully. #f otherwise.
Checks whether file has the prefix specified by self.
In other words, if the names of initial elements of file’s pathname match self. Only full pathname elements are matched, so a path like /foo is not considered a prefix of /foobar, only of /foo/bar.
A <GFile> is not a prefix of itself. If you want to
check for equality, use file:equal?.
This call does no I/O, as it works purely on names. As such it can
sometimes return #f even if file is inside a self
(from a filesystem point of view), because the prefix of file is
an alias of self.
To override it in a new class, give register-type #:vfuncs
`((prefix-matches . ,procedure)). The procedure is called as
(procedure self file) ⇒ %return.
Utility function to check if a particular file exists.
The fallback implementation of this API is using file:query-info and therefore may do blocking I/O. To
asynchronously query the existence of a file, use file:query-info-async.
Note that in many cases it is racy to first check for file existence and then execute something based on the outcome of that, because the file might have been created or removed in between the operations. The general approach to handling that is to not check, but just do the operation and handle the errors as they come.
As an example of race-free checking, take the case of reading a file,
and if it doesn’t exist, creating it. There are two racy versions: read
it, and on error create it; and: check if it exists, if not create it.
These can both result in two processes creating the file (with perhaps a
partially written file as the result). The correct approach is to
always try to create the file with file:create
which will either atomically create the file or fail with a
exists error.
However, in many cases an existence check is useful in a user interface, for instance to make a menu item sensitive/insensitive, so that you don’t have to fool users that something is possible and then just show an error dialog. If you do this, you should make sure to also handle the errors that can happen due to races when you execute the operation.
To override it in a new class, give register-type #:vfuncs
`((query-exists . ,procedure)). The procedure is called as
(procedure self cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the file exists (and can be detected without error),
#f otherwise (or if cancelled).
Similar to file:query-info, but obtains
information about the filesystem the self is on, rather than the
file itself. For instance the amount of space available and the type of
the filesystem.
The attributes value is a string that specifies the attributes
that should be gathered. It is not an error if it’s not possible to
read a particular requested attribute from a file - it just won’t be
set. attributes should be a comma-separated list of attributes or
attribute wildcards. The wildcard "\*" means all attributes, and a
wildcard like "filesystem::*" means all attributes in the filesystem
namespace. The standard namespace for filesystem attributes is
"filesystem". Common attributes of interest are
G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the
filesystem in bytes), G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of
bytes available), and G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of
the filesystem).
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If the file does not exist, the not-found
error will be returned. Other errors are possible too, and depend on
what kind of filesystem the file is on.
To override it in a new class, give register-type #:vfuncs
`((query-filesystem-info . ,procedure)). The procedure is called as
(procedure self attributes cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string.
an attribute query string
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileInfo>.
a <GFileInfo> or #f if there was an error.
Free the returned object with object:unref.
Asynchronously gets the requested information about the filesystem that
the specified self is on. The result is a
<GFileInfo> object that contains key-value
attributes (such as type or size for the file).
For more details, see file:query-filesystem-info which is the
synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:query-info-finish to
get the result of the operation.
To override it in a new class, give register-type #:vfuncs
`((query-filesystem-info-async . ,procedure)). The procedure is
called as (procedure self attributes io-priority cancellable
callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string.
an attribute query string
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous filesystem info query. See file:query-filesystem-info-async.
To override it in a new class, give register-type #:vfuncs
`((query-filesystem-info-finish . ,procedure)). The procedure is
called as (procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileInfo>.
<GFileInfo> for given self or #f on
error. Free the returned object with object:unref.
Gets the requested information about specified self.
The result is a <GFileInfo> object that contains
key-value attributes (such as the type or size of the file).
The attributes value is a string that specifies the file
attributes that should be gathered. It is not an error if it’s not
possible to read a particular requested attribute from a file — it just
won’t be set. In particular this means that if a file is inaccessible
(due to being in a folder with restrictive permissions), for example,
you can expect the returned <GFileInfo> to have
very few attributes set. You should check whether an attribute is set
using file-info:has-attribute?
before trying to retrieve its value.
It is guaranteed that if any of the following attributes are listed in
attributes, they will always be set in the returned
<GFileInfo>, even if the user doesn’t have
permissions to access the file:
Gio.FILE_ATTRIBUTE_STANDARD_NAME
Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
attributes should be a comma-separated list of attributes or
attribute wildcards. The wildcard "\*" means all attributes, and
a wildcard like "standard::*" means all attributes in the
standard namespace. An example attribute query might be
"standard::*,owner::user". The standard attributes are available
as defines, like Gio.FILE_ATTRIBUTE_STANDARD_NAME.
If cancellable is not NULL, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error Gio.IOErrorEnum.CANCELLED
will be returned.
For symlinks, normally the information about the target of the symlink
is returned, rather than information about the symlink itself. However
if you pass Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS in
flags the information about the symlink itself will be returned.
Also, for symlinks that point to non-existing files the information
about the symlink itself will be returned.
If the file does not exist, the Gio.IOErrorEnum.NOT_FOUND error
will be returned. Other errors are possible too, and depend on what
kind of file system the file is on.
To override it in a new class, give register-type #:vfuncs
`((query-info . ,procedure)). The procedure is called as
(procedure self attributes flags cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input file
Passed: a string.
an attribute query string
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
flags to affect the query operation
Passed, or left out: a <GCancellable>, or
#f.
optional cancellable object
Returned: a <GFileInfo>.
a <GFileInfo> for the given self
Asynchronously gets the requested information about specified
self. The result is a <GFileInfo> object
that contains key-value attributes (such as type or size for the file).
For more details, see file:query-info
which is the synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:query-info-finish to
get the result of the operation.
To override it in a new class, give register-type #:vfuncs
`((query-info-async . ,procedure)). The procedure is called as
(procedure self attributes flags io-priority cancellable callback
user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string.
an attribute query string
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
a set of <GFileQueryInfoFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file info query. See file:query-info-async.
To override it in a new class, give register-type #:vfuncs
`((query-info-finish . ,procedure)). The procedure is called as
(procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileInfo>.
<GFileInfo> for given self or #f on
error. Free the returned object with object:unref.
Obtain the list of settable attributes for the file.
Returns the type and full attribute name of all the attributes that can be set on this file. This doesn’t mean setting it will always succeed though, you might get an access failure, or some specific file may not support a specific attribute.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((query-settable-attributes . ,procedure)). The procedure is called
as (procedure self cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a
<GFileAttributeInfoList>.
a <GFileAttributeInfoList>
describing the settable attributes. When you are done with it, release
it with file-attribute-info-list:unref
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).
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((query-writable-namespaces . ,procedure)). The procedure is called
as (procedure self cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a
<GFileAttributeInfoList>.
a <GFileAttributeInfoList>
describing the writable namespaces. When you are done with it, release
it with file-attribute-info-list:unref
Asynchronously opens self for reading.
For more details, see file:read which is the
synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:read-finish to get the
result of the operation.
To override it in a new class, give register-type #:vfuncs
`((read-async . ,procedure)). The procedure is called as
(procedure self io-priority cancellable callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file read operation started with
file:read-async.
To override it in a new class, give register-type #:vfuncs
`((read-finish . ,procedure)). The procedure is called as
(procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileInputStream>.
a <GFileInputStream> or #f on
error. Free the returned object with object:unref.
Opens a file for reading. The result is a
<GFileInputStream> that can be used to
read the contents of the file.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If the file does not exist, the not-found
error will be returned. If the file is a directory, the
is-directory error will be returned. Other
errors are possible too, and depend on what kind of filesystem the file
is on.
To override it in a new class, give register-type #:vfuncs
`((read-fn . ,procedure)). The procedure is called as
(procedure self cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
<GFile> to read
Passed, or left out: a <GCancellable>, or
#f.
Returned: a <GFileInputStream>.
<GFileInputStream> or #f on error.
Free the returned object with object:unref.
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.
This will try to replace the file in the safest way possible so that any errors during the writing will not affect an already existing copy of the file. For instance, for local files it may write to a temporary file and then atomically rename over the destination when the stream is closed.
By default files created are generally readable by everyone, but if you
pass private in flags the file will
be made readable only to the current user, to the level that is
supported on the target filesystem.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
If you pass in a non-#f etag value and self already
exists, then this value is compared to the current entity tag of the
file, and if they differ an wrong-etag error
is returned. This generally means that the file has been changed since
you last read it. You can get the new etag from
file-output-stream:get-etag
after you’ve finished writing and closed the
<GFileOutputStream>. When you load a new
file you can use file-input-stream:query-info to get the etag of the file.
If make-backup is #t, this function will attempt to make a
backup of the current file before overwriting it. If this fails a
cant-create-backup error will be returned. If
you want to replace anyway, try again with make-backup set to
#f.
If the file is a directory the is-directory
error will be returned, and if the file is some other form of
non-regular file then a not-regular-file error
will be returned. Some file systems don’t allow all file names, and may
return an invalid-filename error, and if the
name is to long filename-too-long will be
returned. Other errors are possible too, and depend on what kind of
filesystem the file is on.
To override it in a new class, give register-type #:vfuncs
`((replace . ,procedure)). The procedure is called as
(procedure self etag make-backup flags cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string, or #f.
an optional entity tag for the current <GFile>, or
NULL to ignore
Passed: a boolean.
#t if a backup should be created
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileOutputStream>.
a <GFileOutputStream> or #f on
error. Free the returned object with object:unref.
Asynchronously overwrites the file, replacing the contents, possibly creating a backup copy of the file first.
For more details, see file:replace which is
the synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:replace-finish to get
the result of the operation.
To override it in a new class, give register-type #:vfuncs
`((replace-async . ,procedure)). The procedure is called as
(procedure self etag make-backup flags io-priority cancellable
callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string, or #f.
an entity tag for the current <GFile>, or #f
to ignore
Passed: a boolean.
#t if a backup should be created
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file replace operation started with
file:replace-async.
To override it in a new class, give register-type #:vfuncs
`((replace-finish . ,procedure)). The procedure is called as
(procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileOutputStream>.
a <GFileOutputStream>, or #f on
error. Free the returned object with object:unref.
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.
For details about the behaviour, see file:replace which does the same thing but returns an output
stream only.
Note that in many non-local file cases read and write streams are not supported, so make sure you really need to do read and write streaming, rather than just opening for reading or writing.
To override it in a new class, give register-type #:vfuncs
`((replace-readwrite . ,procedure)). The procedure is called as
(procedure self etag make-backup flags cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
a <GFile>
Passed: a string, or #f.
an optional entity tag for the current <GFile>, or
NULL to ignore
Passed: a boolean.
#t if a backup should be created
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFileIOStream>.
a <GFileIOStream> or #f on error. Free
the returned object with object:unref.
Asynchronously overwrites the file in read-write mode, replacing the contents, possibly creating a backup copy of the file first.
For more details, see file:replace-readwrite which is the synchronous
version of this call.
When the operation is finished, callback will be called. You can
then call file:replace-readwrite-finish to get the
result of the operation.
To override it in a new class, give register-type #:vfuncs
`((replace-readwrite-async . ,procedure)). The procedure is called as
(procedure self etag make-backup flags io-priority cancellable
callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string, or #f.
an entity tag for the current <GFile>, or #f
to ignore
Passed: a boolean.
#t if a backup should be created
Passed: a <GFileCreateFlags>, or a list of
its symbols, or one of them.
a set of <GFileCreateFlags>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file replace operation started with
file:replace-readwrite-async.
To override it in a new class, give register-type #:vfuncs
`((replace-readwrite-finish . ,procedure)). The procedure is called
as (procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFileIOStream>.
a <GFileIOStream>, or #f on error.
Free the returned object with object:unref.
Resolves a relative path for self to an absolute path.
This call does no blocking I/O.
If the relative-path is an absolute path name, the resolution is done absolutely (without taking self path as base).
To override it in a new class, give register-type #:vfuncs
`((resolve-relative-path . ,procedure)). The procedure is called as
(procedure self relative-path) ⇒ %return.
Sets an attribute in the file with attribute name attribute to value-p.
Some attributes can be unset by setting type to
invalid and value-p to #f.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((set-attribute . ,procedure)). The procedure is called as
(procedure self attribute type value-p flags cancellable) ⇒
%return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string containing the attribute’s name
Passed: a <GFileAttributeType>, or one
of its symbols.
The type of the attribute
Passed: a foreign pointer, or a bytevector, or #f.
a pointer to the value (or the pointer itself if the type is a pointer type)
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
a set of <GFileQueryInfoFlags>
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t if the attribute was set, #f otherwise.
Asynchronously sets the attributes of self with info.
For more details, see file:set-attributes-from-info?, which is the
synchronous version of this call.
When the operation is finished, callback will be called. You can
then call file:set-attributes-finish to get the result of
the operation.
To override it in a new class, give register-type #:vfuncs
`((set-attributes-async . ,procedure)). The procedure is called as
(procedure self info flags io-priority cancellable callback
user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileInfo>.
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes setting an attribute started in file:set-attributes-async.
To override it in a new class, give register-type #:vfuncs
`((set-attributes-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return info.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the attributes were set correctly, #f otherwise.
Returned: a <GFileInfo>.
Tries to set all attributes in the <GFileInfo> on
the target values, not stopping on the first error.
If there is any error during this operation then error will be set
to the first error. Error on particular fields are flagged by setting
the "status" field in the attribute value to
error-setting, which means you can
also detect further errors.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((set-attributes-from-info . ,procedure)). The procedure is called
as (procedure self info flags cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GFileInfo>.
Passed: a <GFileQueryInfoFlags>, or a
list of its symbols, or one of them.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#f if there was any error, #t otherwise.
Renames self to the specified display name.
The display name is converted from UTF-8 to the correct encoding for the target filesystem if possible and the self is renamed to this.
If you want to implement a rename operation in the user interface the
edit name (G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as
the initial value in the rename widget, and then the result after
editing should be passed to file:set-display-name.
On success the resulting converted filename is returned.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((set-display-name . ,procedure)). The procedure is called as
(procedure self display-name cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a <GFile>.
a <GFile> specifying what self was renamed to,
or #f if there was an error. Free the returned object with
object:unref.
Asynchronously sets the display name for a given
<GFile>.
For more details, see file:set-display-name which is the synchronous
version of this call.
When the operation is finished, callback will be called. You can
then call file:set-display-name-finish to get the
result of the operation.
To override it in a new class, give register-type #:vfuncs
`((set-display-name-async . ,procedure)). The procedure is called as
(procedure self display-name io-priority cancellable callback
user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a string.
a string
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes setting a display name started with file:set-display-name-async.
To override it in a new class, give register-type #:vfuncs
`((set-display-name-finish . ,procedure)). The procedure is called as
(procedure self res) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a <GFile>.
a <GFile> or #f on error. Free the returned
object with object:unref.
Starts a file of type mountable. Using
start-operation, you can request callbacks when, for instance,
passwords are needed during authentication.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
When the operation is finished, callback will be called. You can
then call file:mount-mountable-finish to get the result
of the operation.
To override it in a new class, give register-type #:vfuncs
`((start-mountable . ,procedure)). The procedure is called as
(procedure self flags start-operation cancellable callback
user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GDriveStartFlags>, or a list of
its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GMountOperation>,
or #f.
a <GMountOperation>, or #f to avoid
user interaction
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied, or #f
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes a start operation. See file:start-mountable for details.
Finish an asynchronous start operation that was started with
file:start-mountable.
To override it in a new class, give register-type #:vfuncs
`((start-mountable-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the operation finished successfully. #f otherwise.
Stops a file of type mountable.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
When the operation is finished, callback will be called. You can
then call file:stop-mountable-finish? to get the result
of the operation.
To override it in a new class, give register-type #:vfuncs
`((stop-mountable . ,procedure)). The procedure is called as
(procedure self flags mount-operation cancellable callback
user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountUnmountFlags>, or a
list of its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GMountOperation>,
or #f.
a <GMountOperation>, or #f to avoid
user interaction.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied, or #f
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes a stop operation, see file:stop-mountable for details.
Finish an asynchronous stop operation that was started with
file:stop-mountable.
To override it in a new class, give register-type #:vfuncs
`((stop-mountable-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the operation finished successfully. #f otherwise.
Sends self 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 not-supported error. Since GLib 2.66, the
x-gvfs-notrash unix mount option can be used to disable
file:trash? support for particular mounts, the
not-supported error will be returned in that
case. Since 2.82, the x-gvfs-trash unix mount option can be used
to enable file:trash? support for particular
system mounts.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
To override it in a new class, give register-type #:vfuncs
`((trash . ,procedure)). The procedure is called as (procedure
self cancellable) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
<GFile> to send to trash
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Returned: a boolean.
#t on successful trash, #f otherwise.
Asynchronously sends self to the Trash location, if possible.
To override it in a new class, give register-type #:vfuncs
`((trash-async . ,procedure)). The procedure is called as
(procedure self io-priority cancellable callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous file trashing operation, started with
file:trash-async.
To override it in a new class, give register-type #:vfuncs
`((trash-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t on successful trash, #f otherwise.
Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
When the operation is finished, callback will be called. You can
then call file:unmount-mountable-finish? to get the
result of the operation.
To override it in a new class, give register-type #:vfuncs
`((unmount-mountable . ,procedure)). The procedure is called as
(procedure self flags cancellable callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountUnmountFlags>, or a
list of its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an unmount operation, see file:unmount-mountable for details.
Finish an asynchronous unmount operation that was started with
file:unmount-mountable.
To override it in a new class, give register-type #:vfuncs
`((unmount-mountable-finish . ,procedure)). The procedure is called
as (procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the operation finished successfully. #f otherwise.
Unmounts a file of type mountable.
If cancellable is not #f, then the operation can be
cancelled by triggering the cancellable object from another thread. If
the operation was cancelled, the error
cancelled will be returned.
When the operation is finished, callback will be called. You can
then call file:unmount-mountable-finish? to get the
result of the operation.
To override it in a new class, give register-type #:vfuncs
`((unmount-mountable-with-operation . ,procedure)). The procedure is
called as (procedure self flags mount-operation cancellable
callback user-data).
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GMountUnmountFlags>, or a
list of its symbols, or one of them.
flags affecting the operation
Passed, or left out: a <GMountOperation>,
or #f.
a <GMountOperation>, or #f to avoid
user interaction
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f to
ignore
Passed, or left out: a procedure, or #f.
a GAsyncReadyCallback to call when the
request is satisfied
See GAsyncReadyCallback for how it is
called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an unmount operation, see file:unmount-mountable-with-operation
for details.
Finish an asynchronous unmount operation that was started with
file:unmount-mountable-with-operation.
To override it in a new class, give register-type #:vfuncs
`((unmount-mountable-with-operation-finish . ,procedure)). The
procedure is called as (procedure self result) ⇒ %return.
Passed: the class whose implementation to call: a class that implements
<GFile>, or its GType number.
Passed: a <GFile>.
input <GFile>
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the operation finished successfully. #f otherwise.