Gio.FileInfo
const Gio = imports.gi.Gio; let fileInfo = new Gio.FileInfo();
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 [GFileAttribute][gio-GFileAttribute for more information on how GIO handles file attributes.
To obtain a Gio.FileInfo for a Gio.File, use Gio.File.prototype.query_info (or its async variant). To obtain a Gio.FileInfo for a file input or output stream, use Gio.FileInputStream.prototype.query_info or Gio.FileOutputStream.prototype.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.prototype.set_attributes_from_info or Gio.File.prototype.set_attributes_async on a GFile.
However, not all attributes can be changed in the file. For instance, the actual size of a file cannot be changed via Gio.FileInfo.prototype.set_size. You may call Gio.File.prototype.query_settable_attributes and Gio.File.prototype.query_writable_namespaces to discover the settable attributes of a particular file at runtime.
Gio.FileAttributeMatcher allows for searching through a Gio.FileInfo for attributes.
Hierarchy
-
GObject.Object
- Gio.FileInfo
Constructors
Methods
- Gio.FileInfo.prototype.clear_status
- Gio.FileInfo.prototype.copy_into
- Gio.FileInfo.prototype.dup
- Gio.FileInfo.prototype.get_attribute_as_string
- Gio.FileInfo.prototype.get_attribute_boolean
- Gio.FileInfo.prototype.get_attribute_byte_string
- Gio.FileInfo.prototype.get_attribute_data
- Gio.FileInfo.prototype.get_attribute_int32
- Gio.FileInfo.prototype.get_attribute_int64
- Gio.FileInfo.prototype.get_attribute_object
- Gio.FileInfo.prototype.get_attribute_status
- Gio.FileInfo.prototype.get_attribute_string
- Gio.FileInfo.prototype.get_attribute_stringv
- Gio.FileInfo.prototype.get_attribute_type
- Gio.FileInfo.prototype.get_attribute_uint32
- Gio.FileInfo.prototype.get_attribute_uint64
- Gio.FileInfo.prototype.get_content_type
- Gio.FileInfo.prototype.get_deletion_date
- Gio.FileInfo.prototype.get_display_name
- Gio.FileInfo.prototype.get_edit_name
- Gio.FileInfo.prototype.get_etag
- Gio.FileInfo.prototype.get_file_type
- Gio.FileInfo.prototype.get_icon
- Gio.FileInfo.prototype.get_is_backup
- Gio.FileInfo.prototype.get_is_hidden
- Gio.FileInfo.prototype.get_is_symlink
- Gio.FileInfo.prototype.get_modification_time
- Gio.FileInfo.prototype.get_name
- Gio.FileInfo.prototype.get_size
- Gio.FileInfo.prototype.get_sort_order
- Gio.FileInfo.prototype.get_symbolic_icon
- Gio.FileInfo.prototype.get_symlink_target
- Gio.FileInfo.prototype.has_attribute
- Gio.FileInfo.prototype.has_namespace
- Gio.FileInfo.prototype.list_attributes
- Gio.FileInfo.prototype.remove_attribute
- Gio.FileInfo.prototype.set_attribute
- Gio.FileInfo.prototype.set_attribute_boolean
- Gio.FileInfo.prototype.set_attribute_byte_string
- Gio.FileInfo.prototype.set_attribute_int32
- Gio.FileInfo.prototype.set_attribute_int64
- Gio.FileInfo.prototype.set_attribute_mask
- Gio.FileInfo.prototype.set_attribute_object
- Gio.FileInfo.prototype.set_attribute_status
- Gio.FileInfo.prototype.set_attribute_string
- Gio.FileInfo.prototype.set_attribute_stringv
- Gio.FileInfo.prototype.set_attribute_uint32
- Gio.FileInfo.prototype.set_attribute_uint64
- Gio.FileInfo.prototype.set_content_type
- Gio.FileInfo.prototype.set_display_name
- Gio.FileInfo.prototype.set_edit_name
- Gio.FileInfo.prototype.set_file_type
- Gio.FileInfo.prototype.set_icon
- Gio.FileInfo.prototype.set_is_hidden
- Gio.FileInfo.prototype.set_is_symlink
- Gio.FileInfo.prototype.set_modification_time
- Gio.FileInfo.prototype.set_name
- Gio.FileInfo.prototype.set_size
- Gio.FileInfo.prototype.set_sort_order
- Gio.FileInfo.prototype.set_symbolic_icon
- Gio.FileInfo.prototype.set_symlink_target
- Gio.FileInfo.prototype.unset_attribute_mask