Class: Gio::FileInfo
- Inherits:
-
Object
- Object
- Gio::FileInfo
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#attribute_mask=(mask) ⇒ nil
Sets mask on info to match specific attribute types.
-
#clear_status ⇒ nil
Clears the status information from info.
-
#content_type ⇒ String
Gets the file’s content type.
-
#content_type=(content_type) ⇒ nil
Sets the content type attribute for a given GFile::Info.
-
#copy_into(dest_info) ⇒ nil
First clears all of the [GFileAttribute] of dest_info, and then copies all of the file attributes from src_info to dest_info.
-
#deletion_date ⇒ GLib::DateTime
Returns the GDate::Time representing the deletion date of the file, as available in G_FILE_ATTRIBUTE_TRASH_DELETION_DATE.
-
#display_name ⇒ String
Gets a display name for a file.
-
#display_name=(display_name) ⇒ nil
Sets the display name for the current GFile::Info.
-
#dup ⇒ Gio::FileInfo
Duplicates a file info structure.
-
#edit_name ⇒ String
Gets the edit name for a file.
-
#edit_name=(edit_name) ⇒ nil
Sets the edit name for the current file.
-
#etag ⇒ String
Gets the [entity tag] for a given GFile::Info.
-
#file_type ⇒ Gio::FileType
Gets a file’s type (whether it is a regular file, symlink, etc).
-
#file_type=(type) ⇒ nil
Sets the file type in a GFile::Info to type.
-
#get_attribute_as_string(attribute) ⇒ String
Gets the value of a attribute, formated as a string.
-
#get_attribute_boolean(attribute) ⇒ TrueClass
Gets the value of a boolean attribute.
-
#get_attribute_byte_string(attribute) ⇒ String
Gets the value of a byte string attribute.
-
#get_attribute_data(attribute, type, value_pp, status) ⇒ TrueClass
Gets the attribute type, value and status for an attribute key.
-
#get_attribute_int32(attribute) ⇒ Integer
Gets a signed 32-bit integer contained within the attribute.
-
#get_attribute_int64(attribute) ⇒ Integer
Gets a signed 64-bit integer contained within the attribute.
-
#get_attribute_object(attribute) ⇒ GObject::Object
Gets the value of a #GObject attribute.
-
#get_attribute_status(attribute) ⇒ Gio::FileAttributeStatus
Gets the attribute status for an attribute key.
-
#get_attribute_string(attribute) ⇒ String
Gets the value of a string attribute.
-
#get_attribute_stringv(attribute) ⇒ Array<String>
Gets the value of a stringv attribute.
-
#get_attribute_type(attribute) ⇒ Gio::FileAttributeType
Gets the attribute type for an attribute key.
-
#get_attribute_uint32(attribute) ⇒ Integer
Gets an unsigned 32-bit integer contained within the attribute.
-
#get_attribute_uint64(attribute) ⇒ Integer
Gets a unsigned 64-bit integer contained within the attribute.
-
#get_modification_time(result) ⇒ nil
Gets the modification time of the current info and sets it in result.
-
#has_attribute(attribute) ⇒ TrueClass
Checks if a file info structure has an attribute named attribute.
-
#has_namespace(name_space) ⇒ TrueClass
Checks if a file info structure has an attribute in the specified name_space.
-
#icon ⇒ Gio::Icon
Gets the icon for a file.
-
#icon=(icon) ⇒ nil
Sets the icon for a given GFile::Info.
-
#is_backup ⇒ TrueClass
Checks if a file is a backup file.
-
#is_hidden ⇒ TrueClass
Checks if a file is hidden.
-
#is_hidden=(is_hidden) ⇒ nil
Sets the “is_hidden” attribute in a GFile::Info according to is_hidden.
-
#is_symlink ⇒ TrueClass
Checks if a file is a symlink.
-
#is_symlink=(is_symlink) ⇒ nil
Sets the “is_symlink” attribute in a GFile::Info according to is_symlink.
-
#list_attributes(name_space) ⇒ Array<String>
Lists the file info structure’s attributes.
-
#modification_date_time ⇒ GLib::DateTime
Gets the modification time of the current info and returns it as a GDate::Time.
-
#modification_date_time=(mtime) ⇒ nil
Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED and %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC attributes in the file info to the given date/time value.
-
#modification_time=(mtime) ⇒ nil
Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED and %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC attributes in the file info to the given time value.
-
#name ⇒ Gio::filename
Gets the name for a file.
-
#name=(name) ⇒ nil
Sets the name attribute for the current GFile::Info.
-
#new ⇒ Gio::FileInfo
Creates a new file info structure.
-
#remove_attribute(attribute) ⇒ nil
Removes all cases of attribute from info if it exists.
-
#set_attribute(attribute, type, value_p) ⇒ nil
Sets the attribute to contain the given value, if possible.
-
#set_attribute_boolean(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
-
#set_attribute_byte_string(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
-
#set_attribute_int32(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
-
#set_attribute_int64(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
-
#set_attribute_object(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
-
#set_attribute_status(attribute, status) ⇒ TrueClass
Sets the attribute status for an attribute key.
-
#set_attribute_string(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
-
#set_attribute_stringv(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
-
#set_attribute_uint32(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
-
#set_attribute_uint64(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
-
#size ⇒ Integer
Gets the file’s size.
-
#size=(size) ⇒ nil
Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info to the given size.
-
#sort_order ⇒ Integer
Gets the value of the sort_order attribute from the GFile::Info.
-
#sort_order=(sort_order) ⇒ nil
Sets the sort order attribute in the file info structure.
-
#symbolic_icon ⇒ Gio::Icon
Gets the symbolic icon for a file.
-
#symbolic_icon=(icon) ⇒ nil
Sets the symbolic icon for a given GFile::Info.
-
#symlink_target ⇒ String
Gets the symlink target for a given GFile::Info.
-
#symlink_target=(symlink_target) ⇒ nil
Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info to the given symlink target.
-
#unset_attribute_mask ⇒ nil
Unsets a mask set by g_file_info_set_attribute_mask(), if one is set.
Instance Method Details
#attribute_mask=(mask) ⇒ nil
Sets mask on info to match specific attribute types.
#clear_status ⇒ nil
Clears the status information from info.
#content_type ⇒ String
Gets the file’s content type.
#content_type=(content_type) ⇒ nil
Sets the content type attribute for a given GFile::Info. See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
#copy_into(dest_info) ⇒ nil
First clears all of the [GFileAttribute] of dest_info, and then copies all of the file attributes from src_info to dest_info.
#deletion_date ⇒ GLib::DateTime
Returns the GDate::Time representing the deletion date of the file, as available in G_FILE_ATTRIBUTE_TRASH_DELETION_DATE. If the G_FILE_ATTRIBUTE_TRASH_DELETION_DATE attribute is unset, nil is returned.
#display_name ⇒ String
Gets a display name for a file.
#display_name=(display_name) ⇒ nil
Sets the display name for the current GFile::Info. See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
#dup ⇒ Gio::FileInfo
Duplicates a file info structure.
#edit_name ⇒ String
Gets the edit name for a file.
#edit_name=(edit_name) ⇒ nil
Sets the edit name for the current file. See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
#etag ⇒ String
Gets the [entity tag] for a given GFile::Info. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
#file_type ⇒ Gio::FileType
Gets a file’s type (whether it is a regular file, symlink, etc). This is different from the file’s content type, see g_file_info_get_content_type().
#file_type=(type) ⇒ nil
Sets the file type in a GFile::Info to type. See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
#get_attribute_as_string(attribute) ⇒ String
Gets the value of a attribute, formated as a string. This escapes things as needed to make the string valid UTF-8.
#get_attribute_boolean(attribute) ⇒ TrueClass
Gets the value of a boolean attribute. If the attribute does not contain a boolean value, false will be returned.
#get_attribute_byte_string(attribute) ⇒ String
Gets the value of a byte string attribute. If the attribute does not contain a byte string, nil will be returned. nil otherwise.
#get_attribute_data(attribute, type, value_pp, status) ⇒ TrueClass
Gets the attribute type, value and status for an attribute key.
#get_attribute_int32(attribute) ⇒ Integer
Gets a signed 32-bit integer contained within the attribute. If the attribute does not contain a signed 32-bit integer, or is invalid, 0 will be returned.
#get_attribute_int64(attribute) ⇒ Integer
Gets a signed 64-bit integer contained within the attribute. If the attribute does not contain a signed 64-bit integer, or is invalid, 0 will be returned.
#get_attribute_object(attribute) ⇒ GObject::Object
Gets the value of a #GObject attribute. If the attribute does not contain a #GObject, nil will be returned. nil otherwise.
#get_attribute_status(attribute) ⇒ Gio::FileAttributeStatus
Gets the attribute status for an attribute key.
#get_attribute_string(attribute) ⇒ String
Gets the value of a string attribute. If the attribute does not contain a string, nil will be returned. nil otherwise.
#get_attribute_stringv(attribute) ⇒ Array<String>
Gets the value of a stringv attribute. If the attribute does not contain a stringv, nil will be returned. nil otherwise. Do not free. These returned strings are UTF-8.
#get_attribute_type(attribute) ⇒ Gio::FileAttributeType
Gets the attribute type for an attribute key. %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
#get_attribute_uint32(attribute) ⇒ Integer
Gets an unsigned 32-bit integer contained within the attribute. If the attribute does not contain an unsigned 32-bit integer, or is invalid, 0 will be returned.
#get_attribute_uint64(attribute) ⇒ Integer
Gets a unsigned 64-bit integer contained within the attribute. If the attribute does not contain an unsigned 64-bit integer, or is invalid, 0 will be returned.
#get_modification_time(result) ⇒ nil
Gets the modification time of the current info and sets it in result.
#has_attribute(attribute) ⇒ TrueClass
Checks if a file info structure has an attribute named attribute.
#has_namespace(name_space) ⇒ TrueClass
Checks if a file info structure has an attribute in the specified name_space.
#icon ⇒ Gio::Icon
Gets the icon for a file.
#icon=(icon) ⇒ nil
Sets the icon for a given GFile::Info. See %G_FILE_ATTRIBUTE_STANDARD_ICON.
#is_backup ⇒ TrueClass
Checks if a file is a backup file.
#is_hidden ⇒ TrueClass
Checks if a file is hidden.
#is_hidden=(is_hidden) ⇒ nil
Sets the “is_hidden” attribute in a GFile::Info according to is_hidden. See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
#is_symlink ⇒ TrueClass
Checks if a file is a symlink.
#is_symlink=(is_symlink) ⇒ nil
Sets the “is_symlink” attribute in a GFile::Info according to is_symlink. See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
#list_attributes(name_space) ⇒ Array<String>
Lists the file info structure’s attributes. null-terminated array of strings of all of the possible attribute types for the given name_space, or nil on error.
#modification_date_time ⇒ GLib::DateTime
Gets the modification time of the current info and returns it as a GDate::Time.
This requires the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute. If %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC is provided, the resulting GDate::Time will have microsecond precision.
#modification_date_time=(mtime) ⇒ nil
Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED and %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC attributes in the file info to the given date/time value.
#modification_time=(mtime) ⇒ nil
Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED and %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC attributes in the file info to the given time value.
#name ⇒ Gio::filename
Gets the name for a file.
#name=(name) ⇒ nil
Sets the name attribute for the current GFile::Info. See %G_FILE_ATTRIBUTE_STANDARD_NAME.
#new ⇒ Gio::FileInfo
Creates a new file info structure.
#remove_attribute(attribute) ⇒ nil
Removes all cases of attribute from info if it exists.
#set_attribute(attribute, type, value_p) ⇒ nil
Sets the attribute to contain the given value, if possible. To unset the attribute, use %G_FILE_ATTRIBUTE_TYPE_INVALID for type.
#set_attribute_boolean(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
#set_attribute_byte_string(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
#set_attribute_int32(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
#set_attribute_int64(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
#set_attribute_object(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
#set_attribute_status(attribute, status) ⇒ TrueClass
Sets the attribute status for an attribute key. This is only needed by external code that implement g_file_set_attributes_from_info() or similar functions.
The attribute must exist in info for this to work. Otherwise false is returned and info is unchanged.
#set_attribute_string(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
#set_attribute_stringv(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
Sinze: 2.22
#set_attribute_uint32(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
#set_attribute_uint64(attribute, attr_value) ⇒ nil
Sets the attribute to contain the given attr_value, if possible.
#size ⇒ Integer
Gets the file’s size.
#size=(size) ⇒ nil
Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info to the given size.
#sort_order ⇒ Integer
Gets the value of the sort_order attribute from the GFile::Info. See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
#sort_order=(sort_order) ⇒ nil
Sets the sort order attribute in the file info structure. See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
#symbolic_icon ⇒ Gio::Icon
Gets the symbolic icon for a file.
#symbolic_icon=(icon) ⇒ nil
Sets the symbolic icon for a given GFile::Info. See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
#symlink_target ⇒ String
Gets the symlink target for a given GFile::Info.
#symlink_target=(symlink_target) ⇒ nil
Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info to the given symlink target.
#unset_attribute_mask ⇒ nil
Unsets a mask set by g_file_info_set_attribute_mask(), if one is set.