FileImpl
Constructors
Functions
Gets an output stream for appending data to the file. If the file doesn't already exist it is created.
Asynchronously opens @file for appending.
Finishes an asynchronous file append operation started with g_file_append_to_async().
Prepares the file attribute query string for copying to @file.
Given @connection to communicate with a proxy (eg, a #GSocketConnection that is connected to the proxy server), this does the necessary handshake to connect to @proxy_address, and if required, wraps the #GIOStream to handle proxy payload.
Asynchronous version of g_proxy_connect().
See g_proxy_connect().
Copies the file @source to the location specified by @destination. Can not handle recursive copies of directories.
Version of method@Gio.File.copy_async using closures instead of callbacks for easier binding in other languages.
Copies the file attributes from @source to @destination.
Finishes copying the file started with g_file_copy_async().
Creates a new file and returns an output stream for writing to it. The file must not already exist.
Asynchronously creates a new file and returns an output stream for writing to it. The file must not already exist.
Finishes an asynchronous file create operation started with g_file_create_async().
Creates a new file and returns a stream for reading and writing to it. The file must not already exist.
Asynchronously creates a new file and returns a stream for reading and writing to it. The file must not already exist.
Finishes an asynchronous file create operation started with g_file_create_readwrite_async().
Deletes a file. If the @file is a directory, it will only be deleted if it is empty. This has the same semantics as g_unlink().
Asynchronously delete a file. If the @file is a directory, it will only be deleted if it is empty. This has the same semantics as g_unlink().
Finishes deleting a file started with g_file_delete_async().
Starts an asynchronous eject on a mountable. When this operation has completed, @callback will be called with
Finishes an asynchronous eject operation started by g_file_eject_mountable().
Starts an asynchronous eject on a mountable. When this operation has completed, @callback will be called with
Finishes an asynchronous eject operation started by g_file_eject_mountable_with_operation().
Gets the requested information about the files in a directory. The result is a #GFileEnumerator object that will give out #GFileInfo objects for all the files in the directory.
Asynchronously gets the requested information about the files in a directory. The result is a #GFileEnumerator object that will give out #GFileInfo objects for all the files in the directory.
Finishes an async enumerate children operation. See g_file_enumerate_children_async().
Gets a #GMount for the #GFile.
Asynchronously gets the mount for the file.
Finishes an asynchronous find mount request. See g_file_find_enclosing_mount_async().
Gets the base name (the last component of the path) for a given #GFile.
Gets the child of @file for a given @display_name (i.e. a UTF-8 version of the name). If this function fails, it returns null and @error will be set. This is very useful when constructing a #GFile for a new file and the user entered the filename in the user interface, for instance when you select a directory and type a filename in the file selector.
Gets the parse name of the @file. A parse name is a UTF-8 string that describes the file such that one can get the #GFile back using g_file_parse_name().
Gets the path for @descendant relative to @parent.
Gets the URI scheme for a #GFile. RFC 3986 decodes the scheme as: |[ URI = scheme ":" hier-part "#" fragment ]| Common schemes include "file", "http", "ftp", etc.
Checks to see if a #GFile has a given URI scheme.
Asynchronously loads the contents of @file as #GBytes.
Starts an asynchronous load of the @file's contents.
Creates a directory. Note that this will only create a child directory of the immediate parent directory of the path or URI given by the #GFile. To recursively create directories, see g_file_make_directory_with_parents(). This function will fail if the parent directory does not exist, setting
Asynchronously creates a directory.
Finishes an asynchronous directory creation, started with g_file_make_directory_async().
Creates a directory and any parent directories that may not exist similar to 'mkdir -p'. If the file system does not support creating directories, this function will fail, setting @error to %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists, this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike the similar g_mkdir_with_parents().
Creates a symbolic link named @file which contains the string
Asynchronously creates a symbolic link named @file which contains the string @symlink_value.
Finishes an asynchronous symbolic link creation, started with g_file_make_symbolic_link_async().
Recursively measures the disk usage of @file.
Obtains a file or directory monitor for the given file, depending on the type of the file.
Obtains a directory monitor for the given file. This may fail if directory monitoring is not supported.
Obtains a file monitor for the given file. If no file notification mechanism exists, then regular polling of the file is used.
Starts a @mount_operation, mounting the volume that contains the file @location.
Finishes a mount operation started by g_file_mount_enclosing_volume().
Mounts a file of type G_FILE_TYPE_MOUNTABLE. Using @mount_operation, you can request callbacks when, for instance, passwords are needed during authentication.
Finishes a mount operation. See g_file_mount_mountable() for details.
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.
Version of method@Gio.File.move_async using closures instead of callbacks for easier binding in other languages.
Finishes an asynchronous file movement, started with g_file_move_async().
Opens an existing file for reading and writing. The result is a #GFileIOStream that can be used to read and write the contents of the file.
Asynchronously opens @file for reading and writing.
Finishes an asynchronous file read operation started with g_file_open_readwrite_async().
Polls a file of type %G_FILE_TYPE_MOUNTABLE.
Finishes a poll operation. See g_file_poll_mountable() for details.
Returns the #GAppInfo that is registered as the default application to handle the file specified by @file.
Async version of g_file_query_default_handler().
Finishes a g_file_query_default_handler_async() operation.
Utility function to check if a particular file exists. This is implemented using g_file_query_info() and as such does blocking I/O.
Similar to g_file_query_info(), but obtains information about the filesystem the @file is on, rather than the file itself. For instance the amount of space available and the type of the filesystem.
Asynchronously gets the requested information about the filesystem that the specified @file is on. The result is a #GFileInfo object that contains key-value attributes (such as type or size for the file).
Finishes an asynchronous filesystem info query. See g_file_query_filesystem_info_async().
Utility function to inspect the #GFileType of a file. This is implemented using g_file_query_info() and as such does blocking I/O.
Gets the requested information about specified @file. The result is a #GFileInfo object that contains key-value attributes (such as the type or size of the file).
Asynchronously gets the requested information about specified @file. The result is a #GFileInfo object that contains key-value attributes (such as type or size for the file).
Finishes an asynchronous file info query. See g_file_query_info_async().
Obtain the list of settable attributes for the file.
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).
Opens a file for reading. The result is a #GFileInputStream that can be used to read the contents of the file.
Asynchronously opens @file for reading.
Finishes an asynchronous file read operation started with g_file_read_async().
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.
Asynchronously overwrites the file, replacing the contents, possibly creating a backup copy of the file first.
Same as g_file_replace_contents_async() but takes a #GBytes input instead. This function will keep a ref on @contents until the operation is done. Unlike g_file_replace_contents_async() this allows forgetting about the content without waiting for the callback.
Finishes an asynchronous file replace operation started with g_file_replace_async().
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.
Asynchronously overwrites the file in read-write mode, replacing the contents, possibly creating a backup copy of the file first.
Finishes an asynchronous file replace operation started with g_file_replace_readwrite_async().
Resolves a relative path for @file to an absolute path.
Sets an attribute in the file with attribute name @attribute to @value_p.
Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value. If @attribute is of a different type, this operation will fail, returning false.
Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value. If @attribute is of a different type, this operation will fail.
Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value. If @attribute is of a different type, this operation will fail.
Asynchronously sets the attributes of @file with @info.
Tries to set all attributes in the #GFileInfo on the target values, not stopping on the first error.
Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value. If @attribute is of a different type, this operation will fail.
Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value. If @attribute is of a different type, this operation will fail.
Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value. If @attribute is of a different type, this operation will fail.
Renames @file to the specified display name.
Asynchronously sets the display name for a given #GFile.
Finishes setting a display name started with g_file_set_display_name_async().
Starts a file of type %G_FILE_TYPE_MOUNTABLE. Using @start_operation, you can request callbacks when, for instance, passwords are needed during authentication.
Finishes a start operation. See g_file_start_mountable() for details.
Stops a file of type %G_FILE_TYPE_MOUNTABLE.
Finishes a stop operation, see g_file_stop_mountable() for details.
Some proxy protocols expect to be passed a hostname, which they will resolve to an IP address themselves. Others, like SOCKS4, do not allow this. This function will return false if @proxy is implementing such a protocol. When false is returned, the caller should resolve the destination hostname first, and then pass a #GProxyAddress containing the stringified IP address to g_proxy_connect() or g_proxy_connect_async().
Checks if @file supports g-main-context-push-thread-default-context. If this returns false, you cannot perform asynchronous operations on
Sends @file to the "Trashcan", if possible. This is similar to deleting it, but the user can recover it before emptying the trashcan. Trashing is disabled for system mounts by default (see g_unix_mount_is_system_internal()), so this call can return the %G_IO_ERROR_NOT_SUPPORTED error. Since GLib 2.66, the x-gvfs-notrash
unix mount option can be used to disable g_file_trash() support for particular mounts, the %G_IO_ERROR_NOT_SUPPORTED error will be returned in that case. Since 2.82, the x-gvfs-trash
unix mount option can be used to enable g_file_trash() support for particular system mounts.
Asynchronously sends @file to the Trash location, if possible.
Finishes an asynchronous file trashing operation, started with g_file_trash_async().
Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
Finishes an unmount operation, see g_file_unmount_mountable() for details.
Unmounts a file of type %G_FILE_TYPE_MOUNTABLE.
Finishes an unmount operation, see g_file_unmount_mountable_with_operation() for details.