Gio.Vfs¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gio.Vfs(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Entry point for using GIO functionality.
- classmethod get_default()[source]¶
- Returns:
a
Gio.Vfs
, which will be the local file systemGio.Vfs
if no other implementation is available.- Return type:
Gets the default
Gio.Vfs
for 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:
Gets a
Gio.File
for path.
- get_file_for_uri(uri)[source]¶
- Parameters:
uri (
str
) – a string containing a URI- Returns:
a
Gio.File
. Free the returned object withGObject.Object.unref
().- Return type:
Gets a
Gio.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.
- 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.
- parse_name(parse_name)[source]¶
- Parameters:
parse_name (
str
) – a string to be parsed by the VFS module.- Returns:
a
Gio.File
for the given parse_name. Free the returned object withGObject.Object.unref
().- Return type:
This operation never fails, but the returned object might not support any I/O operations if the parse_name cannot be parsed by the
Gio.Vfs
module.
- 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.VfsFileLookupFunc
orNone
) – aGio.VfsFileLookupFunc
uri_data (
object
orNone
) – custom data passed to be passed to uri_func, orNone
parse_name_func (
Gio.VfsFileLookupFunc
orNone
) – aGio.VfsFileLookupFunc
parse_name_data (
object
orNone
) – custom data passed to be passed to parse_name_func, orNone
- Returns:
True
if scheme was successfully registered, orFalse
if a handler for scheme already exists.- Return type:
Registers uri_func and parse_name_func as the
Gio.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 withGio.Vfs
backends.When a
Gio.File
is 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.File
to be created again. In that case, it’s responsibility of parse_name_func to make sure the parse name matches what the customGio.File
implementation 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.
- unregister_uri_scheme(scheme)[source]¶
- Parameters:
scheme (
str
) – an URI scheme, e.g. “http”- Returns:
True
if scheme was successfully unregistered, orFalse
if a handler for scheme does not exist.- Return type:
Unregisters 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:
Gets a
Gio.File
for path.
- do_get_file_for_uri(uri) virtual¶
- Parameters:
uri (
str
) – a string containing a URI- Returns:
a
Gio.File
. Free the returned object withGObject.Object.unref
().- Return type:
Gets a
Gio.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.
- 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¶
-
Checks 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.Cancellable
orNone
) –free_extra_data (
GLib.DestroyNotify
) –
- do_local_file_set_attributes(filename, info, flags, cancellable) virtual¶
- Parameters:
filename (
str
) –info (
Gio.FileInfo
) –flags (
Gio.FileQueryInfoFlags
) –cancellable (
Gio.Cancellable
orNone
) –
- Return type:
- do_parse_name(parse_name) virtual¶
- Parameters:
parse_name (
str
) – a string to be parsed by the VFS module.- Returns:
a
Gio.File
for the given parse_name. Free the returned object withGObject.Object.unref
().- Return type:
This operation never fails, but the returned object might not support any I/O operations if the parse_name cannot be parsed by the
Gio.Vfs
module.