LinuxCommandLibrary

gio-querymodules

Query information about GIO module files

SYNOPSIS

gio-querymodules [OPTION...] [DIRECTORY...]

PARAMETERS

--help
    Show help information and exit

--version
    Print version information and exit

--localfiles
    Generate a cache file in each directory instead of just the first

--ignore-errors
    Skip invalid modules and continue instead of failing

DESCRIPTION

gio-querymodules is a utility from the GLib library that scans directories for GIO loadable modules (.so files) and generates text-based cache files to accelerate module discovery at runtime. GIO modules provide pluggable backends for file I/O, such as GVfs volumes, network protocols, and content types.

The command inspects each module using g_io_module_query(), extracting supported URI schemes, MIME types, and native handlers. It produces architecture-specific cache files named gio-querymodules-<platform>.cache (e.g., gio-querymodules-linux-x86_64.cache).

By default, it creates one cache in the first directory listed (or $libdir/gio/modules if none given). GIO reads these caches during application startup to avoid loading every module. Package managers run this post-install to update caches after adding modules. Manual runs often require elevated privileges for system directories.

CAVEATS

Default mode writes cache only to first directory; use --localfiles for multiples. Requires write access to target directories (often needs sudo). Cache names vary by architecture/platform.

CACHE FILE FORMAT

Plain text with lines like:
/path/to/module.so:ModuleName
Followed by attributes:
#Supported URIs: http=file
#Supported MIMEs: text/plain=*

COMMON USAGE

sudo gio-querymodules /usr/lib/x86_64-linux-gnu/gio/modules/
Regenerates system cache after module updates.

HISTORY

Introduced in GLib 2.16 (2008) with GIO modules; evolved to per-directory caches in GLib 2.30+ for better distribution packaging.

SEE ALSO

gdk-pixbuf-query-loaders(1), gtk-query-immodules(1), update-desktop-database(1)

Copied to clipboard