gio.FileInfo — File Information and Attributes
class gio.FileInfo(gobject.GObject): |
Functionality for manipulating basic metadata for files.
gio.FileInfo
implements methods for getting information that all files should contain,
and allows for manipulation of extended attributes.
See gio.FileAttribute
To obtain a gio.FileInfo
for a gio.File
, use
gio.File.query_info
()
(or its async variant). To obtain a
gio.FileInfo
for a file input or output stream, use
gio.FileInputStream.query_info
() or
gio.FileOutputStream.query_info
()
(or their async variants).
To change the actual attributes of a file, you should then set the attribute in the
gio.FileInfo
and call
gio.File.set_attributes_from_info
() or
gio.File.set_attributes_async
()
on a gio.File
.
However, not all attributes can be changed in the file. For instance, the
actual size of a file cannot be changed via
(). You may call
gio.File.query_settable_attributes
() and
gio.File.query_writable_namespace
()
to discover the settable attributes of a particular file at runtime.
gio.FileAttributeMatcher