Gio.Vfs¶
class — extends GObject.Object
Entry point for using GIO functionality.
Methods¶
get_file_for_path¶
Gets a File for path.
Parameters:
path— a string containing a VFS path.
get_file_for_uri¶
Gets a File for uri.
This operation never fails, but the returned object might not support any I/O operation if the URI is malformed or if the URI scheme is not supported.
Parameters:
uri— a string containing a URI
get_supported_uri_schemes¶
Gets a list of URI schemes supported by vfs.
is_active¶
Checks if the VFS is active.
parse_name¶
This operation never fails, but the returned object might
not support any I/O operations if the parse_name cannot
be parsed by the Vfs module.
Parameters:
parse_name— a string to be parsed by the VFS module.
register_uri_scheme¶
def register_uri_scheme(self, scheme: str, uri_func: VfsFileLookupFunc | None = ..., parse_name_func: VfsFileLookupFunc | None = ...) -> bool
Registers uri_func and parse_name_func as the File URI and parse name
lookup functions for URIs with a scheme matching scheme.
Note that scheme is registered only within the running application, as
opposed to desktop-wide as it happens with GVfs backends.
When a File is requested with an URI containing scheme (e.g. through
File.new_for_uri), uri_func will be called to allow a custom
constructor. The implementation of uri_func should not be blocking, and
must not call Vfs.register_uri_scheme or Vfs.unregister_uri_scheme.
When File.parse_name is called with a parse name obtained from such file,
parse_name_func will be called to allow the File to be created again. In
that case, it's responsibility of parse_name_func to make sure the parse
name matches what the custom File implementation returned when
File.get_parse_name was previously called. The implementation of
parse_name_func should not be blocking, and must not call
Vfs.register_uri_scheme or Vfs.unregister_uri_scheme.
It's an error to call this function twice with the same scheme. To unregister
a custom URI scheme, use Vfs.unregister_uri_scheme.
Parameters:
scheme— an URI scheme, e.g. "http"uri_func— aGVfsFileLookupFuncparse_name_func— aGVfsFileLookupFunc
unregister_uri_scheme¶
Unregisters the URI handler for scheme previously registered with
Vfs.register_uri_scheme.
Parameters:
scheme— an URI scheme, e.g. "http"
Static functions¶
get_default¶
Gets the default Vfs for the system.
get_local¶
Gets the local Vfs for the system.
Virtual methods¶
do_add_writable_namespaces¶
do_get_file_for_path¶
Gets a File for path.
Parameters:
path— a string containing a VFS path.
do_get_file_for_uri¶
Gets a File for uri.
This operation never fails, but the returned object might not support any I/O operation if the URI is malformed or if the URI scheme is not supported.
Parameters:
uri— a string containing a URI
do_get_supported_uri_schemes¶
Gets a list of URI schemes supported by vfs.
do_is_active¶
Checks if the VFS is active.
do_local_file_add_info¶
def do_local_file_add_info(self, filename: str, device: int, attribute_matcher: FileAttributeMatcher, info: FileInfo, cancellable: Cancellable | None, extra_data: int | None, free_extra_data: GLib.DestroyNotify) -> None
do_local_file_moved¶
do_local_file_removed¶
do_local_file_set_attributes¶
def do_local_file_set_attributes(self, filename: str, info: FileInfo, flags: FileQueryInfoFlags | int, cancellable: Cancellable | None = ...) -> bool
do_parse_name¶
This operation never fails, but the returned object might
not support any I/O operations if the parse_name cannot
be parsed by the Vfs module.
Parameters:
parse_name— a string to be parsed by the VFS module.