Stores information about a file system object referenced by a gio.file.File.
Functionality for manipulating basic metadata for files. gio.file_info.FileInfo
implements methods for getting information that all files should
contain, and allows for manipulation of extended attributes.
See file-attributes.html for more information on how GIO
handles file attributes.
Stores information about a file system object referenced by a gio.file.File.
Functionality for manipulating basic metadata for files. gio.file_info.FileInfo implements methods for getting information that all files should contain, and allows for manipulation of extended attributes.
See file-attributes.html for more information on how GIO handles file attributes.
To obtain a gio.file_info.FileInfo for a gio.file.File, use gio.file.File.queryInfo (or its async variant). To obtain a gio.file_info.FileInfo for a file input or output stream, use gio.file_input_stream.FileInputStream.queryInfo or gio.file_output_stream.FileOutputStream.queryInfo (or their async variants).
To change the actual attributes of a file, you should then set the attribute in the gio.file_info.FileInfo and call gio.file.File.setAttributesFromInfo or gio.file.File.setAttributesAsync on a gio.file.File.
However, not all attributes can be changed in the file. For instance, the actual size of a file cannot be changed via gio.file_info.FileInfo.setSize. You may call gio.file.File.querySettableAttributes and gio.file.File.queryWritableNamespaces to discover the settable attributes of a particular file at runtime.
The direct accessors, such as gio.file_info.FileInfo.getName, are slightly more optimized than the generic attribute accessors, such as gio.file_info.FileInfo.getAttributeByteString.This optimization will matter only if calling the API in a tight loop.
It is an error to call these accessors without specifying their required file attributes when creating the gio.file_info.FileInfo. Use gio.file_info.FileInfo.hasAttribute or gio.file_info.FileInfo.listAttributes to check what attributes are specified for a gio.file_info.FileInfo.
gio.file_attribute_matcher.FileAttributeMatcher allows for searching through a gio.file_info.FileInfo for attributes.