Gio.Vfs¶
| Subclasses: | None |
|---|
Methods¶
| Inherited: | GObject.Object (37) |
|---|---|
| Structs: | GObject.ObjectClass (5) |
| class | get_default () |
| class | get_local () |
get_file_for_path (path) |
|
get_file_for_uri (uri) |
|
get_supported_uri_schemes () |
|
is_active () |
|
parse_name (parse_name) |
|
register_uri_scheme (scheme, uri_func, uri_data, parse_name_func, *parse_name_data) |
|
unregister_uri_scheme (scheme) |
Virtual Methods¶
| Inherited: | GObject.Object (7) |
|---|
do_add_writable_namespaces (list) |
|
do_get_file_for_path (path) |
|
do_get_file_for_uri (uri) |
|
do_get_supported_uri_schemes () |
|
do_is_active () |
|
do_local_file_add_info (filename, device, attribute_matcher, info, cancellable, extra_data, free_extra_data) |
|
do_local_file_moved (source, dest) |
|
do_local_file_removed (filename) |
|
do_local_file_set_attributes (filename, info, flags, cancellable) |
|
do_parse_name (parse_name) |
Properties¶
None
Signals¶
| Inherited: | GObject.Object (1) |
|---|
Class Details¶
-
class
Gio.Vfs(**kwargs)¶ Bases: GObject.ObjectAbstract: No Structure: Gio.VfsClassEntry point for using GIO functionality.
-
classmethod
get_default()[source]¶ Returns: a Gio.Vfs.Return type: Gio.VfsGets the default
Gio.Vfsfor the system.
-
classmethod
get_local()[source]¶ Returns: a Gio.Vfs.Return type: Gio.VfsGets the local
Gio.Vfsfor the system.
-
get_file_for_path(path)[source]¶ Parameters: path ( str) – a string containing a VFS path.Returns: a Gio.File. Free the returned object withGObject.Object.unref().Return type: Gio.FileGets a
Gio.Filefor path.
-
get_file_for_uri(uri)[source]¶ Parameters: uri ( str) – a string containing a URIReturns: a Gio.File. Free the returned object withGObject.Object.unref().Return type: Gio.FileGets a
Gio.Filefor 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.
-
get_supported_uri_schemes()[source]¶ Returns: a None-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.Return type: [ str]Gets a list of URI schemes supported by self.
-
is_active()[source]¶ Returns: Trueif construction of the self was successful and it is now active.Return type: boolChecks if the VFS is active.
-
parse_name(parse_name)[source]¶ Parameters: parse_name ( str) – a string to be parsed by the VFS module.Returns: a Gio.Filefor the given parse_name. Free the returned object withGObject.Object.unref().Return type: Gio.FileThis operation never fails, but the returned object might not support any I/O operations if the parse_name cannot be parsed by the
Gio.Vfsmodule.
-
register_uri_scheme(scheme, uri_func, uri_data, parse_name_func, *parse_name_data)[source]¶ Parameters: - scheme (
str) – an URI scheme, e.g. “http” - uri_func (
Gio.VfsFileLookupFuncorNone) – aGio.VfsFileLookupFunc - uri_data (
objectorNone) – custom data passed to be passed to uri_func, orNone - parse_name_func (
Gio.VfsFileLookupFuncorNone) – aGio.VfsFileLookupFunc - parse_name_data (
objectorNone) – custom data passed to be passed to parse_name_func, orNone
Returns: Trueif scheme was successfully registered, orFalseif a handler for scheme already exists.Return type: Registers uri_func and parse_name_func as the
Gio.FileURI 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 withGio.Vfsbackends.When a
Gio.Fileis requested with an URI containing scheme (e.g. throughGio.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 callGio.Vfs.register_uri_scheme() orGio.Vfs.unregister_uri_scheme().When
Gio.File.parse_name() is called with a parse name obtained from such file, parse_name_func will be called to allow theGio.Fileto be created again. In that case, it’s responsibility of parse_name_func to make sure the parse name matches what the customGio.Fileimplementation returned whenGio.File.get_parse_name() was previously called. The implementation of parse_name_func should not be blocking, and must not callGio.Vfs.register_uri_scheme() orGio.Vfs.unregister_uri_scheme().It’s an error to call this function twice with the same scheme. To unregister a custom URI scheme, use
Gio.Vfs.unregister_uri_scheme().New in version 2.50.
- scheme (
-
unregister_uri_scheme(scheme)[source]¶ Parameters: scheme ( str) – an URI scheme, e.g. “http”Returns: Trueif scheme was successfully unregistered, orFalseif a handler for scheme does not exist.Return type: boolUnregisters the URI handler for scheme previously registered with
Gio.Vfs.register_uri_scheme().New in version 2.50.
-
do_add_writable_namespaces(list) virtual¶ Parameters: list ( Gio.FileAttributeInfoList) –
-
do_get_file_for_path(path) virtual¶ Parameters: path ( str) – a string containing a VFS path.Returns: a Gio.File. Free the returned object withGObject.Object.unref().Return type: Gio.FileGets a
Gio.Filefor path.
-
do_get_file_for_uri(uri) virtual¶ Parameters: uri ( str) – a string containing a URIReturns: a Gio.File. Free the returned object withGObject.Object.unref().Return type: Gio.FileGets a
Gio.Filefor 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.
-
do_get_supported_uri_schemes() virtual¶ Returns: a None-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.Return type: [ str]Gets a list of URI schemes supported by vfs.
-
do_is_active() virtual¶ Returns: Trueif construction of the vfs was successful and it is now active.Return type: boolChecks if the VFS is active.
-
do_local_file_add_info(filename, device, attribute_matcher, info, cancellable, extra_data, free_extra_data) virtual¶ Parameters: - filename (
str) – - device (
int) – - attribute_matcher (
Gio.FileAttributeMatcher) – - info (
Gio.FileInfo) – - cancellable (
Gio.CancellableorNone) – - extra_data (
objectorNone) – - free_extra_data (
GLib.DestroyNotify) –
- filename (
-
do_local_file_set_attributes(filename, info, flags, cancellable) virtual¶ Parameters: - filename (
str) – - info (
Gio.FileInfo) – - flags (
Gio.FileQueryInfoFlags) – - cancellable (
Gio.CancellableorNone) –
Return type: - filename (
-
do_parse_name(parse_name) virtual¶ Parameters: parse_name ( str) – a string to be parsed by the VFS module.Returns: a Gio.Filefor the given parse_name. Free the returned object withGObject.Object.unref().Return type: Gio.FileThis operation never fails, but the returned object might not support any I/O operations if the parse_name cannot be parsed by the
Gio.Vfsmodule.
-
classmethod