:right-sidebar: True Vfs =================================================================== .. currentmodule:: gi.repository.Gio .. class:: Vfs(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Entry point for using GIO functionality. Methods ------- .. rst-class:: interim-class .. class:: Vfs :no-index: .. method:: get_default() -> ~gi.repository.Gio.Vfs Gets the default :obj:`~gi.repository.Gio.Vfs` for the system. .. method:: get_file_for_path(path: str) -> ~gi.repository.Gio.File Gets a :obj:`~gi.repository.Gio.File` for ``path``. :param path: a string containing a VFS path. .. method:: get_file_for_uri(uri: str) -> ~gi.repository.Gio.File Gets a :obj:`~gi.repository.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. :param uri: a string containing a URI .. method:: get_local() -> ~gi.repository.Gio.Vfs Gets the local :obj:`~gi.repository.Gio.Vfs` for the system. .. method:: get_supported_uri_schemes() -> list[str] Gets a list of URI schemes supported by ``vfs``. .. method:: is_active() -> bool Checks if the VFS is active. .. method:: parse_name(parse_name: str) -> ~gi.repository.Gio.File This operation never fails, but the returned object might not support any I/O operations if the ``parse_name`` cannot be parsed by the :obj:`~gi.repository.Gio.Vfs` module. :param parse_name: a string to be parsed by the VFS module. .. method:: register_uri_scheme(scheme: str, uri_func: ~typing.Callable[[...], ~gi.repository.Gio.File] | None = None, parse_name_func: ~typing.Callable[[...], ~gi.repository.Gio.File] | None = None, *parse_name_data: ~typing.Any) -> bool Registers ``uri_func`` and ``parse_name_func`` as the :obj:`~gi.repository.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 with GVfs backends. When a :obj:`~gi.repository.Gio.File` is requested with an URI containing ``scheme`` (e.g. through :func:`~gi.repository.Gio.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 :func:`~gi.repository.Gio.Vfs.register_uri_scheme` or :func:`~gi.repository.Gio.Vfs.unregister_uri_scheme`. When :func:`~gi.repository.Gio.File.parse_name` is called with a parse name obtained from such file, ``parse_name_func`` will be called to allow the :obj:`~gi.repository.Gio.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 :obj:`~gi.repository.Gio.File` implementation returned when :func:`~gi.repository.Gio.File.get_parse_name` was previously called. The implementation of ``parse_name_func`` should not be blocking, and must not call :func:`~gi.repository.Gio.Vfs.register_uri_scheme` or :func:`~gi.repository.Gio.Vfs.unregister_uri_scheme`. It's an error to call this function twice with the same scheme. To unregister a custom URI scheme, use :func:`~gi.repository.Gio.Vfs.unregister_uri_scheme`. .. versionadded:: 2.50 :param scheme: an URI scheme, e.g. "http" :param uri_func: a :obj:`~gi.repository.Gio.VfsFileLookupFunc` :param parse_name_func: a :obj:`~gi.repository.Gio.VfsFileLookupFunc` :param parse_name_data: custom data passed to be passed to ``parse_name_func``, or :const:`None` .. method:: unregister_uri_scheme(scheme: str) -> bool Unregisters the URI handler for ``scheme`` previously registered with :func:`~gi.repository.Gio.Vfs.register_uri_scheme`. .. versionadded:: 2.50 :param scheme: an URI scheme, e.g. "http" Virtual Methods --------------- .. rst-class:: interim-class .. class:: Vfs :no-index: .. method:: do_add_writable_namespaces(list: ~gi.repository.Gio.FileAttributeInfoList) -> None The type of the None singleton. :param list: .. method:: do_get_file_for_path(path: str) -> ~gi.repository.Gio.File Gets a :obj:`~gi.repository.Gio.File` for ``path``. :param path: a string containing a VFS path. .. method:: do_get_file_for_uri(uri: str) -> ~gi.repository.Gio.File Gets a :obj:`~gi.repository.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. :param uri: a string containing a URI .. method:: do_get_supported_uri_schemes() -> list[str] Gets a list of URI schemes supported by ``vfs``. .. method:: do_is_active() -> bool Checks if the VFS is active. .. method:: do_local_file_add_info(filename: str, device: int, attribute_matcher: ~gi.repository.Gio.FileAttributeMatcher, info: ~gi.repository.Gio.FileInfo, cancellable: ~gi.repository.Gio.Cancellable | None, extra_data: None, free_extra_data: ~typing.Callable[[None], None]) -> None The type of the None singleton. :param filename: :param device: :param attribute_matcher: :param info: :param cancellable: :param extra_data: :param free_extra_data: .. method:: do_local_file_moved(source: str, dest: str) -> None The type of the None singleton. :param source: :param dest: .. method:: do_local_file_removed(filename: str) -> None The type of the None singleton. :param filename: .. method:: do_local_file_set_attributes(filename: str, info: ~gi.repository.Gio.FileInfo, flags: ~gi.repository.Gio.FileQueryInfoFlags, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> bool The type of the None singleton. :param filename: :param info: :param flags: :param cancellable: .. method:: do_parse_name(parse_name: str) -> ~gi.repository.Gio.File This operation never fails, but the returned object might not support any I/O operations if the ``parse_name`` cannot be parsed by the :obj:`~gi.repository.Gio.Vfs` module. :param parse_name: a string to be parsed by the VFS module. Fields ------ .. rst-class:: interim-class .. class:: Vfs :no-index: .. attribute:: parent_instance