Libraries:Gtk:Gio:GFile
Types
T
ParentT
Constants
InterfaceInfo : Std.Object.T
Nil : T
Functions
GetType() : Gtk.GObject.Type.T
Hash(file @ Std.Address.T) : Std.Integer.SmallT
Creates a hash value for a T.
This call does no blocking i/o.
Virtual: hash
file | gconstpointer to a T. |
Returns | 0 if file is not a valid T, otherwise an integer that can be used as hash value for the T. This function is intended for easily hashing a T to add to a Gtk.Glib.GHashTable.T or similar data structure. |
NewForCommandlineArg(arg @ Std.String.T) : Gtk.Gio.GFile.T
Creates a T 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.
arg | a command line string. |
Returns | a new T. [transfer full] |
NewForPath(path @ Std.String.T) : Gtk.Gio.GFile.T
Constructs a T for a given path. This operation never fails, but the returned object might not support any I/O operation if path is malformed.
path | a string containing a relative or absolute path. The string must be encoded in the glib filename encoding. |
Returns | a new T for the given path. [transfer full] |
NewForUri(uri @ Std.String.T) : Gtk.Gio.GFile.T
Constructs a T 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.
uri | a UTF8 string containing a URI. |
Returns | a T for the given uri. [transfer full] |
ParseName(parse_name @ Std.String.T) : Gtk.Gio.GFile.T
Constructs a T with the given parse_name (i.e. something given by GetParseName). This operation never fails, but the returned object might not support any I/O operation if the parse_name cannot be parsed.
parse_name | a file name or path to be parsed. |
Returns | a new T. [transfer full] |
Methods
:AppendTo(self @ T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileOutputStream.T
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 Gtk.Gio.GFileCreateFlags.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 NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
Some file systems don't allow all file names, and may return an Gtk.Gio.GIOErrorEnum.InvalidFilename error. If the file is a directory the Gtk.Gio.GIOErrorEnum.IsDirectory error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.
file | input T. |
flags | a set of Gtk.Gio.GFileCreateFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileOutputStream.T, or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:AppendTo(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:AppendToAsync(self @ T, flags @ Std.Integer.SmallT, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously opens file for appending.
For more details, see AppendTo which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call AppendToFinish to get the result of the operation.
file | input T. |
flags | a set of Gtk.Gio.GFileCreateFlags.T. |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async] |
user_data | the data to pass to callback function. [closure] |
:AppendToAsync(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:AppendToFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFileOutputStream.T
Finishes an asynchronous file append operation started with AppendToAsync.
file | input T. |
res | Gtk.Gio.GAsyncResult.T |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a valid Gtk.Gio.GFileOutputStream.T or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:AppendToFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:Copy(self @ T, destination @ Gtk.Gio.GFile.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, progress_callback @ Std.Function.T, progress_callback_data @ Std.Address.T, error @ Std.Object.T) : Std.Symbol.T
Copies the file source to the location specified by destination. Can not handle recursive copies of directories.
If the flag Gtk.Gio.GFileCopyFlags.Overwrite is specified an already existing destination file is overwritten.
If the flag Gtk.Gio.GFileCopyFlags.NofollowSymlinks is specified then symlinks will be copied as symlinks, otherwise the target of the source symlink will be copied.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
If progress_callback is not NULL, then the operation can be monitored by setting this to a Gtk.Gio.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 source file does not exist then the G_IO_ERROR_NOT_FOUND error is returned, independent on the status of the destination.
If Gtk.Gio.GFileCopyFlags.Overwrite is not specified and the target exists, then the error G_IO_ERROR_EXISTS is returned.
If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY error is returned. If trying to overwrite a directory with a directory the G_IO_ERROR_WOULD_MERGE error is returned.
If the source is a directory and the target does not exist, or Gtk.Gio.GFileCopyFlags.Overwrite is specified and the target is a file, then the G_IO_ERROR_WOULD_RECURSE error is returned.
If you are interested in copying the T object itself (not the on-disk file), see Dup.
source | input T. |
destination | destination T |
flags | set of Gtk.Gio.GFileCopyFlags.T |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
progress_callback | function to callback with progress information. [scope call] |
progress_callback_data | user data to pass to progress_callback. [closure] |
error | Gtk.Glib.GError.T to set on error, or NULL |
Returns | TRUE on success, FALSE otherwise. |
:Copy(_ @ ParentT, _ @ Gtk.Gio.GFile.T, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T, _ @ Std.Object.T)
:CopyAsync(self @ T, destination @ Gtk.Gio.GFile.T, flags @ Std.Integer.SmallT, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, progress_callback @ Std.Function.T, progress_callback_data @ Std.Address.T, callback @ Std.Function.T, user_data) : Std.Object.T
Copies the file source to the location specified by destination asynchronously. For details of the behaviour, see Copy.
If progress_callback is not NULL, then that function that will be called just like in Copy, however the callback will run in the main loop, not in the thread that is doing the I/O operation.
When the operation is finished, callback will be called. You can then call CopyFinish to get the result of the operation.
source | input T. |
destination | destination T |
flags | set of Gtk.Gio.GFileCopyFlags.T |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
progress_callback | function to callback with progress information |
progress_callback_data | user data to pass to progress_callback |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied |
user_data | the data to pass to callback function |
:CopyAsync(_ @ ParentT, _ @ Gtk.Gio.GFile.T, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T, _ @ Std.Function.T, _ @ Std.Address.T)
:CopyAttributes(self @ T, destination @ Gtk.Gio.GFile.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Copies the file attributes from source 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 Gtk.Gio.GFileCopyFlags.AllMetadata 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.
source | a T with attributes. |
destination | a T to copy attributes to. |
flags | a set of Gtk.Gio.GFileCopyFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, NULL to ignore. |
Returns | TRUE if the attributes were copied successfully, FALSE otherwise. |
:CopyFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Finishes copying the file started with CopyAsync.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a TRUE on success, FALSE on error. |
:CopyFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:Create(self @ T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileOutputStream.T
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 Gtk.Gio.GFileCreateFlags.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 NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
If a file or directory with this name already exists the G_IO_ERROR_EXISTS error will be returned. Some file systems don't allow all file names, and may return an G_IO_ERROR_INVALID_FILENAME error, and if the name is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.
file | input T. |
flags | a set of Gtk.Gio.GFileCreateFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileOutputStream.T for the newly created file, or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:Create(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:CreateAsync(self @ T, flags @ Std.Integer.SmallT, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously creates a new file and returns an output stream for writing to it. The file must not already exist.
For more details, see Create which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call CreateFinish to get the result of the operation.
file | input T. |
flags | a set of Gtk.Gio.GFileCreateFlags.T. |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async] |
user_data | the data to pass to callback function. [closure] |
:CreateAsync(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:CreateFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFileOutputStream.T
Finishes an asynchronous file create operation started with CreateAsync.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileOutputStream.T or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:CreateFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:CreateReadwrite(self @ T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileIOStream.T
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 Gtk.Gio.GFileCreateFlags.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 NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
If a file or directory with this name already exists the Gtk.Gio.GIOErrorEnum.Exists error will be returned. Some file systems don't allow all file names, and may return an Gtk.Gio.GIOErrorEnum.InvalidFilename error, and if the name is too long, Gtk.Gio.GIOErrorEnum.FilenameTooLong 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.
file | a T |
flags | a set of Gtk.Gio.GFileCreateFlags.T |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | return location for a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileIOStream.T for the newly created file, or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:CreateReadwrite(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:CreateReadwriteAsync(self @ T, flags @ Std.Integer.SmallT, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
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 CreateReadwrite which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call CreateReadwriteFinish to get the result of the operation.
file | input T |
flags | a set of Gtk.Gio.GFileCreateFlags.T |
io_priority | the I/O priority of the request |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async] |
user_data | the data to pass to callback function. [closure] |
:CreateReadwriteAsync(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:CreateReadwriteFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFileIOStream.T
Finishes an asynchronous file create operation started with CreateReadwriteAsync.
file | input T |
res | a Gtk.Gio.GAsyncResult.T |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileIOStream.T or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:CreateReadwriteFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:Delete(self @ T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Deletes a file. If the file is a directory, it will only be deleted if it is empty.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
Virtual: delete_file
file | input T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the file was deleted. FALSE otherwise. |
:DeleteFile(_ @ ParentT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:DeleteFileAsync(_ @ ParentT)
:DeleteFileFinish(_ @ ParentT)
:Dup(self @ T) : Gtk.Gio.GFile.T
Duplicates a T handle. This operation does not duplicate the actual file or directory represented by the T; see Copy if attempting to copy a file.
This call does no blocking i/o.
:Dup(_ @ ParentT)
:EjectMountable(self @ T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Warning
EjectMountable has been deprecated since version 2.22 and should not be used in newly-written code. Use EjectMountableWithOperation instead.
:EjectMountable(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:EjectMountableFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Warning
EjectMountableFinish has been deprecated since version 2.22 and should not be used in newly-written code. Use EjectMountableWithOperationFinish instead.
:EjectMountableFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:EjectMountableWithOperation(self @ T, flags @ Std.Integer.SmallT, mount_operation @ Gtk.Gio.GMountOperation.T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
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 EjectMountableWithOperationFinish.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
flags | flags affecting the operation |
mount_operation | a Gtk.Gio.GMountOperation.T, or NULL to avoid user interaction. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied, or NULL. [scope async] |
user_data | the data to pass to callback function. [closure] |
:EjectMountableWithOperation(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GMountOperation.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:EjectMountableWithOperationFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Finishes an asynchronous eject operation started by EjectMountableWithOperation.
file | input T. |
result | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the file was ejected successfully. FALSE otherwise. |
:EjectMountableWithOperationFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:EnumerateChildren(self @ T, attributes @ Std.String.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileEnumerator.T
Gets the requested information about the files in a directory. The result is a Gtk.Gio.GFileEnumerator.T object that will give out Gtk.Gio.GFileInfo.T 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 G_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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned. If the file is not a directory, the G_FILE_ERROR_NOTDIR error will be returned. Other errors are possible too.
file | input T. |
attributes | an attribute query string. |
flags | a set of Gtk.Gio.GFileQueryInfoFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | Gtk.Glib.GError.T for error reporting. |
Returns | A Gtk.Gio.GFileEnumerator.T if successful, NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:EnumerateChildren(_ @ ParentT, _ @ Std.String.T, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:EnumerateChildrenAsync(self @ T, attributes @ Std.String.T, flags @ Std.Integer.SmallT, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously gets the requested information about the files in a directory. The result is a Gtk.Gio.GFileEnumerator.T object that will give out Gtk.Gio.GFileInfo.T objects for all the files in the directory.
For more details, see EnumerateChildren which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call EnumerateChildrenFinish to get the result of the operation.
file | input T. |
attributes | an attribute query string. |
flags | a set of Gtk.Gio.GFileQueryInfoFlags.T. |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async] |
user_data | the data to pass to callback function. [closure] |
:EnumerateChildrenAsync(_ @ ParentT, _ @ Std.String.T, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:EnumerateChildrenFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFileEnumerator.T
Finishes an async enumerate children operation. See EnumerateChildrenAsync.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T. |
Returns | a Gtk.Gio.GFileEnumerator.T or NULL if an error occurred. Free the returned object with g_object_unref(). [transfer full] |
:EnumerateChildrenFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:Equal(self @ T, file2 @ Gtk.Gio.GFile.T) : Std.Symbol.T
Checks equality of two given Ts. Note that two Ts that differ can still refer to the same file on the filesystem due to various forms of filename aliasing.
This call does no blocking i/o.
file1 | the first T. |
file2 | the second T. |
Returns | TRUE if file1 and file2 are equal. FALSE if either is not a T. |
:Equal(_ @ ParentT, _ @ Gtk.Gio.GFile.T)
:FindEnclosingMount(self @ T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GMount.T
Gets a Gtk.Gio.GMount.T for the T.
If the GFileIface for file does not have a mount (e.g. possibly a remote share), error will be set to Gtk.Gio.GIOErrorEnum.NotFound and NULL will be returned.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T. |
Returns | a Gtk.Gio.GMount.T where the file is located or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:FindEnclosingMount(_ @ ParentT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:FindEnclosingMountAsync(self @ T, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously gets the mount for the file.
For more details, see FindEnclosingMount which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call FindEnclosingMountFinish to get the result of the operation.
file | a T |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async] |
user_data | the data to pass to callback function. [closure] |
:FindEnclosingMountAsync(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:FindEnclosingMountFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GMount.T
Finishes an asynchronous find mount request. See FindEnclosingMountAsync.
file | a T |
res | a Gtk.Gio.GAsyncResult.T |
error | a Gtk.Glib.GError.T |
Returns | Gtk.Gio.GMount.T for given file or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:FindEnclosingMountFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:GetBasename(self @ T) : Std.String.T
Gets the base name (the last component of the path) for a given T.
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 QueryInfo.
This call does no blocking i/o.
file | input T. |
Returns | string containing the T's base name, or NULL if given T is invalid. The returned string should be freed with g_free() when no longer needed. |
:GetBasename(_ @ ParentT)
:GetChild(self @ T, name @ Std.String.T) : Gtk.Gio.GFile.T
Gets a child of file with basename equal to name.
Note that the file with that specific name might not exist, but you can still have a T that points to it. You can use this for instance to create that file.
This call does no blocking i/o.
file | input T. |
name | string containing the child's basename. |
Returns | a T to a child specified by name. Free the returned object with g_object_unref(). [transfer full] |
:GetChildForDisplayName(self @ T, display_name @ Std.String.T, error @ Std.Object.T) : Gtk.Gio.GFile.T
Gets the child of file for a given display_name (i.e. a UTF8 version of the name). If this function fails, it returns NULL and error will be set. This is very useful when constructing a GFile for a new file and the user entered the filename in the user interface, for instance when you select a directory and type a filename in the file selector.
This call does no blocking i/o.
file | input T. |
display_name | string to a possible child. |
error | Gtk.Glib.GError.T. |
Returns | a T to the specified child, or NULL if the display name couldn't be converted. Free the returned object with g_object_unref(). [transfer full] |
:GetChildForDisplayName(_ @ ParentT, _ @ Std.String.T, _ @ Std.Object.T)
:GetParent(self @ T) : Gtk.Gio.GFile.T
Gets the parent directory for the file. If the file represents the root directory of the file system, then NULL will be returned.
This call does no blocking i/o.
file | input T. |
Returns | a T structure to the parent of the given T or NULL if there is no parent. Free the returned object with g_object_unref(). [transfer full] |
:GetParent(_ @ ParentT)
:GetParseName(self @ T) : Std.String.T
Gets the parse name of the file. A parse name is a UTF-8 string that describes the file such that one can get the T back using ParseName.
This is generally used to show the T 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 UTF8 the pathname is used, otherwise the IRI is used (a form of URI that allows UTF8 characters unescaped).
This call does no blocking i/o.
file | input T. |
Returns | a string containing the T's parse name. The returned string should be freed with g_free() when no longer needed. |
:GetParseName(_ @ ParentT)
:GetPath(self @ T) : Std.String.T
Gets the local pathname for T, if one exists.
This call does no blocking i/o.
file | input T. |
Returns | string containing the T's path, or NULL if no such path exists. The returned string should be freed with g_free() when no longer needed. |
:GetPath(_ @ ParentT)
:GetRelativePath(self @ T, descendant @ Gtk.Gio.GFile.T) : Std.String.T
Gets the path for descendant relative to parent.
This call does no blocking i/o.
parent | input T. |
descendant | input T. |
Returns | string with the relative path from descendant to parent, or NULL if descendant doesn't have parent as prefix. The returned string should be freed with g_free() when no longer needed. |
:GetRelativePath(_ @ ParentT, _ @ Gtk.Gio.GFile.T)
:GetUri(self @ T) : Std.String.T
Gets the URI for the file.
This call does no blocking i/o.
file | input T. |
Returns | a string containing the T's URI. The returned string should be freed with g_free() when no longer needed. |
:GetUri(_ @ ParentT)
:GetUriScheme(self @ T) : Std.String.T
Gets the URI scheme for a T. RFC 3986 decodes the scheme as:
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
Common schemes include "file", "http", "ftp", etc.
This call does no blocking i/o.
file | input T. |
Returns | a string containing the URI scheme for the given T. The returned string should be freed with g_free() when no longer needed. |
:GetUriScheme(_ @ ParentT)
:HasParent(self @ T, parent @ Gtk.Gio.GFile.T) : Std.Symbol.T
Checks if file has a parent, and optionally, if it is parent.
If parent is NULL then this function returns TRUE if file has any parent at all. If parent is non-NULL then TRUE is only returned if file is a child of parent.
file | input T |
parent | the parent to check for, or NULL |
Returns | TRUE if file is a child of parent (or any parent in the case that parent is NULL). |
:HasPrefix(self @ T, prefix @ Gtk.Gio.GFile.T) : Std.Symbol.T
Checks whether file has the prefix specified by prefix. In other word, if the names of initial elements of files 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.
This call does no i/o, as it works purely on names. As such it can sometimes return FALSE even if file is inside a prefix (from a filesystem point of view), because the prefix of file is an alias of prefix.
Virtual: prefix_matches
file | input T. |
prefix | input T. |
Returns | TRUE if the files's parent, grandparent, etc is prefix. FALSE otherwise. |
:HasUriScheme(self @ T, uri_scheme @ Std.String.T) : Std.Symbol.T
Checks to see if a T has a given URI scheme.
This call does no blocking i/o.
file | input T. |
uri_scheme | a string containing a URI scheme. |
Returns | TRUE if T's backend supports the given URI scheme, FALSE if URI scheme is NULL, not supported, or T is invalid. |
:HasUriScheme(_ @ ParentT, _ @ Std.String.T)
:Hash(_ @ ParentT)
:IsNative(self @ T) : Std.Symbol.T
Checks to see if a file is native to the platform.
A native file s 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 FALSE, but GetPath will still return a native path.
This call does no blocking i/o.
:IsNative(_ @ ParentT)
:LoadContents(self @ T, cancellable @ Gtk.Gio.GCancellable.T, contents @ Std.Object.T, length @ Std.Object.T, etag_out @ Std.Object.T, error @ Std.Object.T) : Std.Symbol.T
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 content should be freed with g_free() when no longer needed.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
contents | a location to place the contents of the file. [out][transfer full][element-type guint8][array length=length] |
length | a location to place the length of the contents of the file, or NULL if the length is not needed. [out][allow-none] |
etag_out | a location to place the current entity tag for the file, or NULL if the entity tag is not needed. [out][allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the file's contents were successfully loaded. FALSE if there were errors. |
:LoadContentsAsync(self @ T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Starts an asynchronous load of the file's contents.
For more details, see LoadContents 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 LoadContentsFinish with the Gtk.Gio.GAsyncResult.T returned by the callback.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied |
user_data | the data to pass to callback function |
:LoadContentsFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, contents @ Std.Object.T, length @ Std.Object.T, etag_out @ Std.Object.T, error @ Std.Object.T) : Std.Symbol.T
Finishes an asynchronous load of the file's contents. The contents are placed in contents, and length is set to the size of the contents string. The content should be freed with g_free() when no longer needed. If etag_out is present, it will be set to the new entity tag for the file.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
contents | a location to place the contents of the file. [out][transfer full][element-type guint8][array length=length] |
length | a location to place the length of the contents of the file, or NULL if the length is not needed. [out][allow-none] |
etag_out | a location to place the current entity tag for the file, or NULL if the entity tag is not needed. [out][allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the load was successful. If FALSE and error is present, it will be set appropriately. |
:LoadPartialContentsAsync(self @ T, cancellable @ Gtk.Gio.GCancellable.T, read_more_callback @ Std.Function.T, callback @ Std.Function.T, user_data) : Std.Object.T
Reads the partial contents of a file. A Gtk.Gio.GFileReadMoreCallback should be used to stop reading from the file when appropriate, else this function will behave exactly as LoadContentsAsync. This operation can be finished by LoadPartialContentsFinish.
Users of this function should be aware that user_data is passed to both the read_more_callback and the callback.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
read_more_callback | a Gtk.Gio.GFileReadMoreCallback to receive partial data and to specify whether further data should be read. |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied |
user_data | the data to pass to the callback functions. |
:LoadPartialContentsFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, contents @ Std.Object.T, length @ Std.Object.T, etag_out @ Std.Object.T, error @ Std.Object.T) : Std.Symbol.T
Finishes an asynchronous partial load operation that was started with LoadPartialContentsAsync. The data is always zero-terminated, but this is not included in the resultant length. The returned content should be freed with g_free() when no longer needed.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
contents | a location to place the contents of the file. [out][transfer full][element-type guint8][array length=length] |
length | a location to place the length of the contents of the file, or NULL if the length is not needed. [out][allow-none] |
etag_out | a location to place the current entity tag for the file, or NULL if the entity tag is not needed. [out][allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the load was successful. If FALSE and error is present, it will be set appropriately. |
:MakeDirectory(self @ T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
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 T. To recursively create directories, see MakeDirectoryWithParents. This function will fail if the parent directory does not exist, setting error to Gtk.Gio.GIOErrorEnum.NotFound. If the file system doesn't support creating directories, this function will fail, setting error to Gtk.Gio.GIOErrorEnum.NotSupported.
For a local T the newly created directory will have the default (current) ownership and permissions of the current process.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE on successful creation, FALSE otherwise. |
:MakeDirectory(_ @ ParentT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:MakeDirectoryAsync(_ @ ParentT)
:MakeDirectoryFinish(_ @ ParentT)
:MakeDirectoryWithParents(self @ T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
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 Gtk.Gio.GIOErrorEnum.NotSupported.
For a local T the newly created directories will have the default (current) ownership and permissions of the current process.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if all directories have been successfully created, FALSE otherwise. |
:MakeSymbolicLink(self @ T, symlink_value @ Std.String.T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Creates a symbolic link named file which contains the string symlink_value.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | a T with the name of the symlink to create |
symlink_value | a string with the path for the target of the new symlink |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T. |
Returns | TRUE on the creation of a new symlink, FALSE otherwise. |
:MakeSymbolicLink(_ @ ParentT, _ @ Std.String.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:MakeSymbolicLinkAsync(_ @ ParentT)
:MakeSymbolicLinkFinish(_ @ ParentT)
:Monitor(self @ T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileMonitor.T
Obtains a file or directory monitor for the given file, depending on the type of the file.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T |
flags | a set of Gtk.Gio.GFileMonitorFlags.T |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileMonitor.T for the given file, or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:MonitorDir(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:MonitorFile(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:MountEnclosingVolume(self @ T, flags @ Gtk.Gio.GMountMountFlags.T, mount_operation @ Gtk.Gio.GMountOperation.T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Starts a mount_operation, mounting the volume that contains the file location.
When this operation has completed, callback will be called with user_user data, and the operation can be finalized with MountEnclosingVolumeFinish.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
location | input T. |
flags | flags affecting the operation |
mount_operation | a Gtk.Gio.GMountOperation.T or NULL to avoid user interaction. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied, or NULL. |
user_data | the data to pass to callback function |
:MountEnclosingVolume(_ @ ParentT, _ @ Gtk.Gio.GMountMountFlags.T, _ @ Gtk.Gio.GMountOperation.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:MountEnclosingVolumeFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Finishes a mount operation started by MountEnclosingVolume.
location | input T. |
result | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if successful. If an error has occurred, this function will return FALSE and set error appropriately if present. |
:MountEnclosingVolumeFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:MountMountable(self @ T, flags @ Gtk.Gio.GMountMountFlags.T, mount_operation @ Gtk.Gio.GMountOperation.T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
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 NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
When the operation is finished, callback will be called. You can then call MountMountableFinish to get the result of the operation.
file | input T. |
flags | flags affecting the operation |
mount_operation | a Gtk.Gio.GMountOperation.T, or NULL to avoid user interaction. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied, or NULL. [scope async] |
user_data | the data to pass to callback function. [closure] |
:MountMountable(_ @ ParentT, _ @ Gtk.Gio.GMountMountFlags.T, _ @ Gtk.Gio.GMountOperation.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:MountMountableFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFile.T
Finishes a mount operation. See MountMountable for details.
Finish an asynchronous mount operation that was started with MountMountable.
file | input T. |
result | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a T or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:MountMountableFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:Move(self @ T, destination @ Gtk.Gio.GFile.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, progress_callback @ Std.Function.T, progress_callback_data @ Std.Address.T, error @ Std.Object.T) : Std.Symbol.T
Tries to move the file or directory source to the location specified by destination. If native move operations are supported then this is used, otherwise a copy + delete fallback is used. The native implementation may support moving directories (for instance on moves inside the same filesystem), but the fallback code does not.
If the flag Gtk.Gio.GFileCopyFlags.Overwrite is specified an already existing destination file is overwritten.
If the flag Gtk.Gio.GFileCopyFlags.NofollowSymlinks is specified then symlinks will be copied as symlinks, otherwise the target of the source symlink will be copied.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
If progress_callback is not NULL, then the operation can be monitored by setting this to a Gtk.Gio.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 source file does not exist then the G_IO_ERROR_NOT_FOUND error is returned, independent on the status of the destination.
If Gtk.Gio.GFileCopyFlags.Overwrite is not specified and the target exists, then the error G_IO_ERROR_EXISTS is returned.
If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY error is returned. If trying to overwrite a directory with a directory the G_IO_ERROR_WOULD_MERGE error is returned.
If the source is a directory and the target does not exist, or Gtk.Gio.GFileCopyFlags.Overwrite is specified and the target is a file, then the G_IO_ERROR_WOULD_RECURSE error may be returned (if the native move operation isn't available).
source | T pointing to the source location. |
destination | T pointing to the destination location. |
flags | set of Gtk.Gio.GFileCopyFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
progress_callback | Gtk.Gio.GFileProgressCallback function for updates. [scope call] |
progress_callback_data | gpointer to user data for the callback function. [closure] |
error | Gtk.Glib.GError.T for returning error conditions, or NULL |
Returns | TRUE on successful move, FALSE otherwise. |
:Move(_ @ ParentT, _ @ Gtk.Gio.GFile.T, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T, _ @ Std.Object.T)
:MoveAsync(_ @ ParentT)
:MoveFinish(_ @ ParentT)
:OpenReadwrite(self @ T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileIOStream.T
Opens an existing file for reading and writing. The result is a Gtk.Gio.GFileIOStream.T that can be used to read and write the contents of the file.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned. If the file is a directory, the G_IO_ERROR_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.
file | T to open |
cancellable | a Gtk.Gio.GCancellable.T. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | Gtk.Gio.GFileIOStream.T or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:OpenReadwrite(_ @ ParentT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:OpenReadwriteAsync(self @ T, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously opens file for reading and writing.
For more details, see OpenReadwrite which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call OpenReadwriteFinish to get the result of the operation.
file | input T. |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async] |
user_data | the data to pass to callback function. [closure] |
:OpenReadwriteAsync(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:OpenReadwriteFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFileIOStream.T
Finishes an asynchronous file read operation started with OpenReadwriteAsync.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileIOStream.T or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:OpenReadwriteFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:PollMountable(self @ T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Polls a file of type G_FILE_TYPE_MOUNTABLE.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
When the operation is finished, callback will be called. You can then call MountMountableFinish to get the result of the operation.
file | input T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied, or NULL. |
user_data | the data to pass to callback function |
:PollMountable(_ @ ParentT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:PollMountableFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Finishes a poll operation. See PollMountable for details.
Finish an asynchronous poll operation that was polled with PollMountable.
file | input T. |
result | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the operation finished successfully. FALSE otherwise. |
:PollMountableFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:PrefixMatches(_ @ ParentT, _ @ Gtk.Gio.GFile.T)
:QueryDefaultHandler(self @ T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GAppInfo.T
Returns the Gtk.Gio.GAppInfo.T that is registered as the default application to handle the file specified by file.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | a T to open. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GAppInfo.T if the handle was found, NULL if there were errors. When you are done with it, release it with g_object_unref(). [transfer full] |
:QueryExists(self @ T, cancellable @ Gtk.Gio.GCancellable.T) : Std.Symbol.T
Utility function to check if a particular file exists. This is implemented using QueryInfo and as such does blocking I/O.
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 Create which will either atomically create the file or fail with a G_IO_ERROR_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 and 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.
file | input T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
Returns | TRUE if the file exists (and can be detected without error), FALSE otherwise (or if cancelled). |
:QueryFileType(self @ T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T) : Gtk.Gio.GFileType.T
Utility function to inspect the Gtk.Gio.GFileType.T of a file. This is implemented using QueryInfo 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.
file | input T. |
flags | a set of Gtk.Gio.GFileQueryInfoFlags.T passed to QueryInfo. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
Returns | The Gtk.Gio.GFileType.T of the file and Gtk.Gio.GFileType.Unknown if the file does not exist |
:QueryFilesystemInfo(self @ T, attributes @ Std.String.T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileInfo.T
Similar to QueryInfo, but obtains information about the filesystem the file is on, rather than the file itself. For instance the amount of space available and the type of the filesystem.
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 "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 NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.
file | input T. |
attributes | an attribute query string. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T. |
Returns | a Gtk.Gio.GFileInfo.T or NULL if there was an error. Free the returned object with g_object_unref(). [transfer full] |
:QueryFilesystemInfo(_ @ ParentT, _ @ Std.String.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:QueryFilesystemInfoAsync(self @ T, attributes @ Std.String.T, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously gets the requested information about the filesystem that the specified file is on. The result is a Gtk.Gio.GFileInfo.T object that contains key-value attributes (such as type or size for the file).
For more details, see QueryFilesystemInfo which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call QueryInfoFinish to get the result of the operation.
file | input T. |
attributes | an attribute query string. |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async] |
user_data | the data to pass to callback function. [closure] |
:QueryFilesystemInfoAsync(_ @ ParentT, _ @ Std.String.T, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:QueryFilesystemInfoFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFileInfo.T
Finishes an asynchronous filesystem info query. See QueryFilesystemInfoAsync.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T. |
Returns | Gtk.Gio.GFileInfo.T for given file or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:QueryFilesystemInfoFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:QueryInfo(self @ T, attributes @ Std.String.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileInfo.T
Gets the requested information about specified file. The result is a Gtk.Gio.GFileInfo.T 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. 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 G_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 Gtk.Gio.GIOErrorEnum.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 Gtk.Gio.GFileQueryInfoFlags.NofollowSymlinks 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 G_IO_ERROR_NOT_FOUND error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.
file | input T. |
attributes | an attribute query string. |
flags | a set of Gtk.Gio.GFileQueryInfoFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T. |
Returns | a Gtk.Gio.GFileInfo.T for the given file, or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:QueryInfo(_ @ ParentT, _ @ Std.String.T, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:QueryInfoAsync(self @ T, attributes @ Std.String.T, flags @ Std.Integer.SmallT, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously gets the requested information about specified file. The result is a Gtk.Gio.GFileInfo.T object that contains key-value attributes (such as type or size for the file).
For more details, see QueryInfo which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call QueryInfoFinish to get the result of the operation.
file | input T. |
attributes | an attribute query string. |
flags | a set of Gtk.Gio.GFileQueryInfoFlags.T. |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async] |
user_data | the data to pass to callback function. [closure] |
:QueryInfoAsync(_ @ ParentT, _ @ Std.String.T, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:QueryInfoFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFileInfo.T
Finishes an asynchronous file info query. See QueryInfoAsync.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T. |
Returns | Gtk.Gio.GFileInfo.T for given file or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:QueryInfoFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:QuerySettableAttributes(self @ T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileAttributeInfoList.T
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 NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileAttributeInfoList.T describing the settable attributes. When you are done with it, release it with Gtk.Gio.GFileAttributeInfoList.Unref |
:QuerySettableAttributes(_ @ ParentT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:QuerySettableAttributesAsync(_ @ ParentT)
:QuerySettableAttributesFinish(_ @ ParentT)
:QueryWritableNamespaces(self @ T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileAttributeInfoList.T
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 NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileAttributeInfoList.T describing the writable namespaces. When you are done with it, release it with Gtk.Gio.GFileAttributeInfoList.Unref |
:QueryWritableNamespaces(_ @ ParentT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:QueryWritableNamespacesAsync(_ @ ParentT)
:QueryWritableNamespacesFinish(_ @ ParentT)
:Read(self @ T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileInputStream.T
Opens a file for reading. The result is a Gtk.Gio.GFileInputStream.T that can be used to read the contents of the file.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned. If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.
Virtual: read_fn
file | T to read. |
cancellable | a Gtk.Gio.GCancellable.T. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | Gtk.Gio.GFileInputStream.T or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:ReadAsync(self @ T, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously opens file for reading.
For more details, see Read which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call ReadFinish to get the result of the operation.
file | input T |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async] |
user_data | the data to pass to callback function. [closure] |
:ReadAsync(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:ReadFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFileInputStream.T
Finishes an asynchronous file read operation started with ReadAsync.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileInputStream.T or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:ReadFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:ReadFn(_ @ ParentT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:Replace(self @ T, etag @ Std.String.T, make_backup @ Std.Symbol.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileOutputStream.T
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 Gtk.Gio.GFileCreateFlags.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 NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
If you pass in a non-NULL etag value, then this value is compared to the current entity tag of the file, and if they differ an G_IO_ERROR_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 Gtk.Gio.GFileOutputStream.GetEtag after you've finished writing and closed the Gtk.Gio.GFileOutputStream.T. When you load a new file you can use Gtk.Gio.GFileInputStream.QueryInfo to get the etag of the file.
If make_backup is TRUE, this function will attempt to make a backup of the current file before overwriting it. If this fails a G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you want to replace anyway, try again with make_backup set to FALSE.
If the file is a directory the G_IO_ERROR_IS_DIRECTORY error will be returned, and if the file is some other form of non-regular file then a G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some file systems don't allow all file names, and may return an G_IO_ERROR_INVALID_FILENAME error, and if the name is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.
file | input T. |
etag | an optional entity tag for the current T, or NULL to ignore. [allow-none] |
make_backup | TRUE if a backup should be created. |
flags | a set of Gtk.Gio.GFileCreateFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileOutputStream.T or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:Replace(_ @ ParentT, _ @ Std.String.T, _ @ Std.Symbol.T, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:ReplaceAsync(self @ T, etag @ Std.String.T, make_backup @ Std.Symbol.T, flags @ Std.Integer.SmallT, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously overwrites the file, replacing the contents, possibly creating a backup copy of the file first.
For more details, see Replace which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call ReplaceFinish to get the result of the operation.
file | input T. |
etag | an entity tag for the current T, or NULL to ignore. [allow-none] |
make_backup | TRUE if a backup should be created. |
flags | a set of Gtk.Gio.GFileCreateFlags.T. |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async] |
user_data | the data to pass to callback function. [closure] |
:ReplaceAsync(_ @ ParentT, _ @ Std.String.T, _ @ Std.Symbol.T, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:ReplaceContents(self @ T, contents @ Std.String.T, length @ Std.Integer.SmallT, etag @ Std.String.T, make_backup @ Std.Symbol.T, flags @ Std.Integer.SmallT, new_etag @ Std.Object.T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Replaces the contents of file with contents of length bytes. If etag is specified (not NULL) any existing file must have that etag, or the error Gtk.Gio.GIOErrorEnum.WrongEtag will be returned.
If make_backup is TRUE, this function will attempt to make a backup of file.
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 Gtk.Gio.GIOErrorEnum.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.
file | input T. |
contents | a string containing the new contents for file. [element-type guint8][array length=length] |
length | the length of contents in bytes. |
etag | the old entity tag for the document, or NULL. [allow-none] |
make_backup | TRUE if a backup should be created. |
flags | a set of Gtk.Gio.GFileCreateFlags.T. |
new_etag | a location to a new entity tag for the document. This should be freed with g_free() when no longer needed, or NULL. [allow-none][out] |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if successful. If an error has occurred, this function will return FALSE and set error appropriately if present. |
:ReplaceContentsAsync(self @ T, contents @ Std.String.T, length @ Std.Integer.SmallT, etag @ Std.String.T, make_backup @ Std.Symbol.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Starts an asynchronous replacement of file 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 ReplaceContentsFinish.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
If make_backup is TRUE, this function will attempt to make a backup of file.
file | input T. |
contents | string of contents to replace the file with. [element-type guint8][array length=length] |
length | the length of contents in bytes. |
etag | a new entity tag for the file, or NULL. [allow-none] |
make_backup | TRUE if a backup should be created. |
flags | a set of Gtk.Gio.GFileCreateFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied |
user_data | the data to pass to callback function |
:ReplaceContentsFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, new_etag @ Std.Object.T, error @ Std.Object.T) : Std.Symbol.T
Finishes an asynchronous replace of the given file. See ReplaceContentsAsync. Sets new_etag to the new entity tag for the document, if present.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
new_etag | a location of a new entity tag for the document. This should be freed with g_free() when it is no longer needed, or NULL. [out][allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE on success, FALSE on failure. |
:ReplaceFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFileOutputStream.T
Finishes an asynchronous file replace operation started with ReplaceAsync.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileOutputStream.T, or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:ReplaceFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:ReplaceReadwrite(self @ T, etag @ Std.String.T, make_backup @ Std.Symbol.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileIOStream.T
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 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.
file | a T |
etag | an optional entity tag for the current T, or NULL to ignore. [allow-none] |
make_backup | TRUE if a backup should be created |
flags | a set of Gtk.Gio.GFileCreateFlags.T |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | return location for a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileIOStream.T or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:ReplaceReadwrite(_ @ ParentT, _ @ Std.String.T, _ @ Std.Symbol.T, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:ReplaceReadwriteAsync(self @ T, etag @ Std.String.T, make_backup @ Std.Symbol.T, flags @ Std.Integer.SmallT, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously overwrites the file in read-write mode, replacing the contents, possibly creating a backup copy of the file first.
For more details, see ReplaceReadwrite which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call ReplaceReadwriteFinish to get the result of the operation.
file | input T. |
etag | an entity tag for the current T, or NULL to ignore. [allow-none] |
make_backup | TRUE if a backup should be created. |
flags | a set of Gtk.Gio.GFileCreateFlags.T. |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async] |
user_data | the data to pass to callback function. [closure] |
:ReplaceReadwriteAsync(_ @ ParentT, _ @ Std.String.T, _ @ Std.Symbol.T, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:ReplaceReadwriteFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFileIOStream.T
Finishes an asynchronous file replace operation started with ReplaceReadwriteAsync.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a Gtk.Gio.GFileIOStream.T, or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:ReplaceReadwriteFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:ResolveRelativePath(self @ T, relative_path @ Std.String.T) : Gtk.Gio.GFile.T
Resolves a relative path for file to an absolute path.
This call does no blocking i/o.
file | input T. |
relative_path | a given relative path string. |
Returns | T to the resolved path. NULL if relative_path is NULL or if file is invalid. Free the returned object with g_object_unref(). [transfer full] |
:ResolveRelativePath(_ @ ParentT, _ @ Std.String.T)
:SetAttribute(self @ T, attribute @ Std.String.T, type @ Gtk.Gio.GFileAttributeType.T, value_p @ Std.Address.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Sets an attribute in the file with attribute name attribute to value.
Some attributes can be unset by setting attribute to Gtk.Gio.GFileAttributeType.Invalid and value to NULL.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
attribute | a string containing the attribute's name. |
type | The type of the attribute |
value_p | a pointer to the value (or the pointer itself if the type is a pointer type) |
flags | a set of Gtk.Gio.GFileQueryInfoFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the attribute was set, FALSE otherwise. |
:SetAttribute(_ @ ParentT, _ @ Std.String.T, _ @ Gtk.Gio.GFileAttributeType.T, _ @ Std.Address.T, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:SetAttributeByteString(self @ T, attribute @ Std.String.T, value @ Std.String.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Sets attribute of type Gtk.Gio.GFileAttributeType.ByteString to value. If attribute is of a different type, this operation will fail, returning FALSE.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
attribute | a string containing the attribute's name. |
value | a string containing the attribute's new value. |
flags | a Gtk.Gio.GFileQueryInfoFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the attribute was successfully set to value in the file, FALSE otherwise. |
:SetAttributeInt32(self @ T, attribute @ Std.String.T, value @ Std.Integer.SmallT, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Sets attribute of type Gtk.Gio.GFileAttributeType.Int32 to value. If attribute is of a different type, this operation will fail.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
attribute | a string containing the attribute's name. |
value | a gint32 containing the attribute's new value. |
flags | a Gtk.Gio.GFileQueryInfoFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the attribute was successfully set to value in the file, FALSE otherwise. |
:SetAttributeInt64(self @ T, attribute @ Std.String.T, value @ Std.Integer.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Sets attribute of type Gtk.Gio.GFileAttributeType.Int64 to value. If attribute is of a different type, this operation will fail.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
attribute | a string containing the attribute's name. |
value | a guint64 containing the attribute's new value. |
flags | a Gtk.Gio.GFileQueryInfoFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the attribute was successfully set, FALSE otherwise. |
:SetAttributeString(self @ T, attribute @ Std.String.T, value @ Std.String.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Sets attribute of type Gtk.Gio.GFileAttributeType.String to value. If attribute is of a different type, this operation will fail.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
attribute | a string containing the attribute's name. |
value | a string containing the attribute's value. |
flags | Gtk.Gio.GFileQueryInfoFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the attribute was successfully set, FALSE otherwise. |
:SetAttributeUint32(self @ T, attribute @ Std.String.T, value @ Std.Integer.SmallT, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Sets attribute of type Gtk.Gio.GFileAttributeType.Uint32 to value. If attribute is of a different type, this operation will fail.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
attribute | a string containing the attribute's name. |
value | a guint32 containing the attribute's new value. |
flags | a Gtk.Gio.GFileQueryInfoFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the attribute was successfully set to value in the file, FALSE otherwise. |
:SetAttributeUint64(self @ T, attribute @ Std.String.T, value @ Std.Integer.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Sets attribute of type Gtk.Gio.GFileAttributeType.Uint64 to value. If attribute is of a different type, this operation will fail.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
attribute | a string containing the attribute's name. |
value | a guint64 containing the attribute's new value. |
flags | a Gtk.Gio.GFileQueryInfoFlags.T. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the attribute was successfully set to value in the file, FALSE otherwise. |
:SetAttributesAsync(self @ T, info @ Gtk.Gio.GFileInfo.T, flags @ Std.Integer.SmallT, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously sets the attributes of file with info.
For more details, see SetAttributesFromInfo which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call SetAttributesFinish to get the result of the operation.
file | input T. |
info | a Gtk.Gio.GFileInfo.T. |
flags | a Gtk.Gio.GFileQueryInfoFlags.T. |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback. [scope async] |
user_data | a gpointer. [closure] |
:SetAttributesAsync(_ @ ParentT, _ @ Gtk.Gio.GFileInfo.T, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:SetAttributesFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, info @ Std.Object.T, error @ Std.Object.T) : Std.Symbol.T
Finishes setting an attribute started in SetAttributesAsync.
file | input T. |
result | a Gtk.Gio.GAsyncResult.T. |
info | a Gtk.Gio.GFileInfo.T. [out][transfer full] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the attributes were set correctly, FALSE otherwise. |
:SetAttributesFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T, _ @ Std.Object.T)
:SetAttributesFromInfo(self @ T, info @ Gtk.Gio.GFileInfo.T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Tries to set all attributes in the Gtk.Gio.GFileInfo.T 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 Gtk.Gio.GFileAttributeStatus.ErrorSetting, which means you can also detect further errors.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
info | a Gtk.Gio.GFileInfo.T. |
flags | Gtk.Gio.GFileQueryInfoFlags.T |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if there was any error, FALSE otherwise. |
:SetAttributesFromInfo(_ @ ParentT, _ @ Gtk.Gio.GFileInfo.T, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:SetDisplayName(self @ T, display_name @ Std.String.T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFile.T
Renames file to the specified display name.
The display name is converted from UTF8 to the correct encoding for the target filesystem if possible and the file 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 SetDisplayName.
On success the resulting converted filename is returned.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | input T. |
display_name | a string. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a T specifying what file was renamed to, or NULL if there was an error. Free the returned object with g_object_unref(). [transfer full] |
:SetDisplayName(_ @ ParentT, _ @ Std.String.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:SetDisplayNameAsync(self @ T, display_name @ Std.String.T, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously sets the display name for a given T.
For more details, see SetDisplayName which is the synchronous version of this call.
When the operation is finished, callback will be called. You can then call SetDisplayNameFinish to get the result of the operation.
file | input T. |
display_name | a string. |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied. [scope async] |
user_data | the data to pass to callback function. [closure] |
:SetDisplayNameAsync(_ @ ParentT, _ @ Std.String.T, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:SetDisplayNameFinish(self @ T, res @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFile.T
Finishes setting a display name started with SetDisplayNameAsync.
file | input T. |
res | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | a T or NULL on error. Free the returned object with g_object_unref(). [transfer full] |
:SetDisplayNameFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:StartMountable(self @ T, flags @ Gtk.Gio.GDriveStartFlags.T, start_operation @ Gtk.Gio.GMountOperation.T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Starts a file of type G_FILE_TYPE_MOUNTABLE. Using start_operation, you can request callbacks when, for instance, passwords are needed during authentication.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
When the operation is finished, callback will be called. You can then call MountMountableFinish to get the result of the operation.
file | input T. |
flags | flags affecting the operation |
start_operation | a Gtk.Gio.GMountOperation.T, or NULL to avoid user interaction. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied, or NULL. |
user_data | the data to pass to callback function |
:StartMountable(_ @ ParentT, _ @ Gtk.Gio.GDriveStartFlags.T, _ @ Gtk.Gio.GMountOperation.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:StartMountableFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Finishes a start operation. See StartMountable for details.
Finish an asynchronous start operation that was started with StartMountable.
file | input T. |
result | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the operation finished successfully. FALSE otherwise. |
:StartMountableFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:StopMountable(self @ T, flags @ Std.Integer.SmallT, mount_operation @ Gtk.Gio.GMountOperation.T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Stops a file of type G_FILE_TYPE_MOUNTABLE.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
When the operation is finished, callback will be called. You can then call StopMountableFinish to get the result of the operation.
file | input T. |
flags | flags affecting the operation |
mount_operation | a Gtk.Gio.GMountOperation.T, or NULL to avoid user interaction. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied, or NULL. |
user_data | the data to pass to callback function |
:StopMountable(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GMountOperation.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:StopMountableFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Finishes an stop operation, see StopMountable for details.
Finish an asynchronous stop operation that was started with StopMountable.
file | input T. |
result | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the operation finished successfully. FALSE otherwise. |
:StopMountableFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:SupportsThreadContexts(self @ T) : Std.Symbol.T
Checks if file supports
file | a T. |
Returns | Whether or not file supports thread-default contexts. |
:Trash(self @ T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Std.Symbol.T
Sends file to the "Trashcan", if possible. This is similar to deleting it, but the user can recover it before emptying the trashcan. Not all file systems support trashing, so this call can return the Gtk.Gio.GIOErrorEnum.NotSupported error.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
file | T to send to trash. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE on successful trash, FALSE otherwise. |
:Trash(_ @ ParentT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:TrashAsync(_ @ ParentT)
:TrashFinish(_ @ ParentT)
:UnmountMountable(self @ T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Warning
UnmountMountable has been deprecated since version 2.22 and should not be used in newly-written code. Use UnmountMountableWithOperation instead.
:UnmountMountable(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:UnmountMountableFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Warning
UnmountMountableFinish has been deprecated since version 2.22 and should not be used in newly-written code. Use UnmountMountableWithOperationFinish instead.
:UnmountMountableFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:UnmountMountableWithOperation(self @ T, flags @ Std.Integer.SmallT, mount_operation @ Gtk.Gio.GMountOperation.T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
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 Gtk.Gio.GIOErrorEnum.Cancelled will be returned.
When the operation is finished, callback will be called. You can then call UnmountMountableFinish to get the result of the operation.
file | input T. |
flags | flags affecting the operation |
mount_operation | a Gtk.Gio.GMountOperation.T, or NULL to avoid user interaction. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback to call when the request is satisfied, or NULL. [scope async] |
user_data | the data to pass to callback function. [closure] |
:UnmountMountableWithOperation(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GMountOperation.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:UnmountMountableWithOperationFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Finishes an unmount operation, see UnmountMountableWithOperation for details.
Finish an asynchronous unmount operation that was started with UnmountMountableWithOperation.
file | input T. |
result | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, or NULL |
Returns | TRUE if the operation finished successfully. FALSE otherwise. |
T is a high level abstraction for manipulating files on a virtual file system. Ts are lightweight, immutable objects that do no I/O upon creation. It is necessary to understand that T objects do not represent files, merely an identifier for a file. All file content I/O is implemented as streaming operations (see Gtk.Gio.GInputStream.T and Gtk.Gio.GOutputStream.T).
To construct a T, you can use: g_file_new_for_path() if you have a path. g_file_new_for_uri() if you have a URI. g_file_new_for_commandline_arg() for a command line argument. ParseName from a utf8 string gotten from GetParseName.
One way to think of a T is as an abstraction of a pathname. For normal files the system pathname is what is stored internally, but as Ts are extensible it could also be something else that corresponds to a pathname in a userspace implementation of a filesystem.
Ts make up hierarchies of directories and files that correspond to the files on a filesystem. You can move through the file system with T using GetParent to get an identifier for the parent directory, GetChild to get a child within a directory, ResolveRelativePath to resolve a relative path between two Ts. There can be multiple hierarchies, so you may not end up at the same root if you repeatedly call GetParent on two different files.
All Ts have a basename (get with GetBasename). 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 QueryInfo. This is guaranteed to be in utf8 and can be used in a user interface. But always store the real basename or the T to use to actually access the file, because there is no way to go from a display name to the actual name.
Using T 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 Ts 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 Ts point to the same file you can query for the G_FILE_ATTRIBUTE_ID_FILE attribute. Note that T 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 Ts.
Many T 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 Gtk.Gio.GAsyncReadyCallback which is then used to finalize the operation, producing a GAsyncResult which is then passed to the function's matching _finish() operation.
Some T operations do not have synchronous analogs, as they may take a very long time to finish, and blocking may leave an application unusable. Notable cases include: MountMountable to mount a mountable file. UnmountMountableWithOperation to unmount a mountable file. EjectMountableWithOperation to eject a mountable file.
One notable feature of Ts are entity tags, or "etags" for short. Entity tags are somewhat like a more abstract version of the traditional mtime, and can be used to quickly determine if the file has been modified from the version on the file system. See the HTTP 1.1 specification for HTTP Etag headers, which are a very similar concept.