Package: gio
Function gio:file-query-info
Lambda Listgio:file-query-info (file attributes flags &optional cancellable) ArgumentsReturn ValueDetails
Gets the requested information about the specified file. The result is a g:file-info instance that contains key-value
attributes, such as the type or size of the file. The attributes value is a string that specifies the file attributes that should be gathered. It is not an error if it is not possible to read a particular requested attribute from a file, it just will not be set. The attributes argument should be a comma-separated list of attributes or attribute wildcards. The wildcard "" means all attributes, and a wildcard like "standard::" means all attributes in the standard namespace. An example attribute query be "standard::*,owner::user". If the cancellable argument is not nil, then the operation can be cancelled by triggering the cancellable instance from another thread. For symlinks, normally the information about the target of the symlink is returned, rather than information about the symlink itself. However if you pass :nofollow-symlinks in flags the information about the symlink itself will be returned. Also, for symlinks that point to non-existing files the information about the symlink itself will be returned. Examples
(let* ((path (glib-sys:sys-path "test/rtest-gio-file.lisp" "cl-cffi-glib"))
(file (g:file-new-for-path path))
(info (g:file-query-info file "standard::*" :none)))
(g:file-info-list-attributes info))
=> ("standard::type" "standard::is-hidden" "standard::is-backup"
"standard::is-symlink" "standard::name" "standard::display-name"
"standard::edit-name" "standard::copy-name" "standard::icon"
"standard::content-type" "standard::fast-content-type"
"standard::size" "standard::allocated-size" "standard::symbolic-icon") | See also |
2026-03-21