gi-gio-2.0.27: Gio bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gio.Objects.FileInfo

Contents

- Exported types
- Methods
  - Overloaded methods
  - clearStatus
  - copyInto
  - dup
  - getAttributeAsString
  - getAttributeBoolean
  - getAttributeByteString
  - getAttributeData
  - getAttributeInt32
  - getAttributeInt64
  - getAttributeObject
  - getAttributeStatus
  - getAttributeString
  - getAttributeStringv
  - getAttributeType
  - getAttributeUint32
  - getAttributeUint64
  - getContentType
  - getDeletionDate
  - getDisplayName
  - getEditName
  - getEtag
  - getFileType
  - getIcon
  - getIsBackup
  - getIsHidden
  - getIsSymlink
  - getModificationDateTime
  - getModificationTime
  - getName
  - getSize
  - getSortOrder
  - getSymbolicIcon
  - getSymlinkTarget
  - hasAttribute
  - hasNamespace
  - listAttributes
  - new
  - removeAttribute
  - setAttribute
  - setAttributeBoolean
  - setAttributeByteString
  - setAttributeInt32
  - setAttributeInt64
  - setAttributeMask
  - setAttributeObject
  - setAttributeStatus
  - setAttributeString
  - setAttributeStringv
  - setAttributeUint32
  - setAttributeUint64
  - setContentType
  - setDisplayName
  - setEditName
  - setFileType
  - setIcon
  - setIsHidden
  - setIsSymlink
  - setModificationDateTime
  - setModificationTime
  - setName
  - setSize
  - setSortOrder
  - setSymbolicIcon
  - setSymlinkTarget
  - unsetAttributeMask

Description

Functionality for manipulating basic metadata for files. `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 `FileInfo` for a `File`, use `fileQueryInfo` (or its async variant). To obtain a `FileInfo` for a file input or output stream, use `fileInputStreamQueryInfo` or `fileOutputStreamQueryInfo` (or their async variants).

To change the actual attributes of a file, you should then set the attribute in the `FileInfo` and call `fileSetAttributesFromInfo` or `fileSetAttributesAsync` 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 `fileInfoSetSize`. You may call `fileQuerySettableAttributes` and `fileQueryWritableNamespaces` to discover the settable attributes of a particular file at runtime.

`FileAttributeMatcher` allows for searching through a `FileInfo` for attributes.

Synopsis

- newtype FileInfo = FileInfo (ManagedPtr FileInfo)
- class (GObject o, IsDescendantOf FileInfo o) => IsFileInfo o
- toFileInfo :: (MonadIO m, IsFileInfo o) => o -> m FileInfo
- fileInfoClearStatus :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m ()
- fileInfoCopyInto :: (HasCallStack, MonadIO m, IsFileInfo a, IsFileInfo b) => a -> b -> m ()
- fileInfoDup :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m FileInfo
- fileInfoGetAttributeAsString :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m (Maybe Text)
- fileInfoGetAttributeBoolean :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m Bool
- fileInfoGetAttributeByteString :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m (Maybe Text)
- fileInfoGetAttributeData :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m (Bool, FileAttributeType, Ptr (), FileAttributeStatus)
- fileInfoGetAttributeInt32 :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m Int32
- fileInfoGetAttributeInt64 :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m Int64
- fileInfoGetAttributeObject :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m (Maybe Object)
- fileInfoGetAttributeStatus :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m FileAttributeStatus
- fileInfoGetAttributeString :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m (Maybe Text)
- fileInfoGetAttributeStringv :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m (Maybe [Text])
- fileInfoGetAttributeType :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m FileAttributeType
- fileInfoGetAttributeUint32 :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m Word32
- fileInfoGetAttributeUint64 :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m Word64
- fileInfoGetContentType :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m (Maybe Text)
- fileInfoGetDeletionDate :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m (Maybe DateTime)
- fileInfoGetDisplayName :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m Text
- fileInfoGetEditName :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m Text
- fileInfoGetEtag :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m Text
- fileInfoGetFileType :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m FileType
- fileInfoGetIcon :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m Icon
- fileInfoGetIsBackup :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m Bool
- fileInfoGetIsHidden :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m Bool
- fileInfoGetIsSymlink :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m Bool
- fileInfoGetModificationDateTime :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m (Maybe DateTime)
- fileInfoGetModificationTime :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m TimeVal
- fileInfoGetName :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m [Char]
- fileInfoGetSize :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m Int64
- fileInfoGetSortOrder :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m Int32
- fileInfoGetSymbolicIcon :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m Icon
- fileInfoGetSymlinkTarget :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m Text
- fileInfoHasAttribute :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m Bool
- fileInfoHasNamespace :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m Bool
- fileInfoListAttributes :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Maybe Text -> m (Maybe [Text])
- fileInfoNew :: (HasCallStack, MonadIO m) => m FileInfo
- fileInfoRemoveAttribute :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m ()
- fileInfoSetAttribute :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> FileAttributeType -> Ptr () -> m ()
- fileInfoSetAttributeBoolean :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> Bool -> m ()
- fileInfoSetAttributeByteString :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> Text -> m ()
- fileInfoSetAttributeInt32 :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> Int32 -> m ()
- fileInfoSetAttributeInt64 :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> Int64 -> m ()
- fileInfoSetAttributeMask :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> FileAttributeMatcher -> m ()
- fileInfoSetAttributeObject :: (HasCallStack, MonadIO m, IsFileInfo a, IsObject b) => a -> Text -> b -> m ()
- fileInfoSetAttributeStatus :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> FileAttributeStatus -> m Bool
- fileInfoSetAttributeString :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> Text -> m ()
- fileInfoSetAttributeStringv :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> [Text] -> m ()
- fileInfoSetAttributeUint32 :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> Word32 -> m ()
- fileInfoSetAttributeUint64 :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> Word64 -> m ()
- fileInfoSetContentType :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m ()
- fileInfoSetDisplayName :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m ()
- fileInfoSetEditName :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m ()
- fileInfoSetFileType :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> FileType -> m ()
- fileInfoSetIcon :: (HasCallStack, MonadIO m, IsFileInfo a, IsIcon b) => a -> b -> m ()
- fileInfoSetIsHidden :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Bool -> m ()
- fileInfoSetIsSymlink :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Bool -> m ()
- fileInfoSetModificationDateTime :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> DateTime -> m ()
- fileInfoSetModificationTime :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> TimeVal -> m ()
- fileInfoSetName :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> [Char] -> m ()
- fileInfoSetSize :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Int64 -> m ()
- fileInfoSetSortOrder :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Int32 -> m ()
- fileInfoSetSymbolicIcon :: (HasCallStack, MonadIO m, IsFileInfo a, IsIcon b) => a -> b -> m ()
- fileInfoSetSymlinkTarget :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m ()
- fileInfoUnsetAttributeMask :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m ()

# Exported types

newtype FileInfo Source #

Memory-managed wrapper type.

Constructors

FileInfo (ManagedPtr FileInfo) |

#### Instances

Instances details

Eq FileInfo Source # |
Instance details Defined in GI.Gio.Objects.FileInfo Methods (==) :: FileInfo -> FileInfo -> Bool # (/=) :: FileInfo -> FileInfo -> Bool #
GObject FileInfo Source # |
Instance details Defined in GI.Gio.Objects.FileInfo
TypedObject FileInfo Source # |
Instance details Defined in GI.Gio.Objects.FileInfo Methods glibType :: IO GType Source #
ManagedPtrNewtype FileInfo Source # |
Instance details Defined in GI.Gio.Objects.FileInfo Methods toManagedPtr :: FileInfo -> ManagedPtr FileInfo Source #
IsGValue FileInfo Source # | Convert `FileInfo` to and from `GValue` with `toGValue` and `fromGValue`.
Instance details Defined in GI.Gio.Objects.FileInfo Methods toGValue :: FileInfo -> IO GValue Source # fromGValue :: GValue -> IO FileInfo Source #
HasParentTypes FileInfo Source # |
Instance details Defined in GI.Gio.Objects.FileInfo
type ParentTypes FileInfo Source # |
Instance details Defined in GI.Gio.Objects.FileInfo type ParentTypes FileInfo = '[Object]

class (GObject o, IsDescendantOf FileInfo o) => IsFileInfo o Source #

Type class for types which can be safely cast to `FileInfo`, for instance with `toFileInfo`.

#### Instances

Instances details

(GObject o, IsDescendantOf FileInfo o) => IsFileInfo o Source # |
Instance details Defined in GI.Gio.Objects.FileInfo

toFileInfo :: (MonadIO m, IsFileInfo o) => o -> m FileInfo Source #

Cast to `FileInfo`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

## Overloaded methods

## clearStatus

fileInfoClearStatus Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m () |

Clears the status information from `info`.

## copyInto

fileInfoCopyInto Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a, IsFileInfo b) |
=> a | `srcInfo`: source to copy attributes from.
-> b | `destInfo`: destination to copy attributes to.
-> m () |

First clears all of the [GFileAttribute][gio-GFileAttribute] of `destInfo`, and then copies all of the file attributes from `srcInfo` to `destInfo`.

## dup

fileInfoDup Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `other`: a `FileInfo`.
-> m FileInfo | Returns: a duplicate `FileInfo` of `other`.

Duplicates a file info structure.

## getAttributeAsString

fileInfoGetAttributeAsString Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m (Maybe Text) | Returns: a UTF-8 string associated with the given `attribute`, or `Nothing` if the attribute wasn’t set. When you're done with the string it must be freed with `free`.

Gets the value of a attribute, formatted as a string. This escapes things as needed to make the string valid UTF-8.

## getAttributeBoolean

fileInfoGetAttributeBoolean Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m Bool | Returns: the boolean value contained within the attribute.

Gets the value of a boolean attribute. If the attribute does not contain a boolean value, `False` will be returned.

## getAttributeByteString

fileInfoGetAttributeByteString Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m (Maybe Text) | Returns: the contents of the `attribute` value as a byte string, or `Nothing` otherwise.

Gets the value of a byte string attribute. If the attribute does not contain a byte string, `Nothing` will be returned.

## getAttributeData

fileInfoGetAttributeData Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`
-> Text | `attribute`: a file attribute key
-> m (Bool, FileAttributeType, Ptr (), FileAttributeStatus) | Returns: `True` if `info` has an attribute named `attribute`, `False` otherwise.

Gets the attribute type, value and status for an attribute key.

## getAttributeInt32

fileInfoGetAttributeInt32 Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m Int32 | Returns: a signed 32-bit integer from the attribute.

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.

## getAttributeInt64

fileInfoGetAttributeInt64 Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m Int64 | Returns: a signed 64-bit integer from the attribute.

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.

## getAttributeObject

fileInfoGetAttributeObject Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m (Maybe Object) | Returns: a `Object` associated with the given `attribute`, or `Nothing` otherwise.

Gets the value of a `Object` attribute. If the attribute does not contain a `Object`, `Nothing` will be returned.

## getAttributeStatus

fileInfoGetAttributeStatus Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`
-> Text | `attribute`: a file attribute key
-> m FileAttributeStatus | Returns: a `FileAttributeStatus` for the given `attribute`, or `FileAttributeStatusUnset` if the key is invalid.

Gets the attribute status for an attribute key.

## getAttributeString

fileInfoGetAttributeString Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m (Maybe Text) | Returns: the contents of the `attribute` value as a UTF-8 string, or `Nothing` otherwise.

Gets the value of a string attribute. If the attribute does not contain a string, `Nothing` will be returned.

## getAttributeStringv

fileInfoGetAttributeStringv Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m (Maybe [Text]) | Returns: the contents of the `attribute` value as a stringv, or `Nothing` otherwise. Do not free. These returned strings are UTF-8.

Gets the value of a stringv attribute. If the attribute does not contain a stringv, `Nothing` will be returned.

Since: 2.22

## getAttributeType

fileInfoGetAttributeType Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m FileAttributeType | Returns: a `FileAttributeType` for the given `attribute`, or `FileAttributeTypeInvalid` if the key is not set.

Gets the attribute type for an attribute key.

## getAttributeUint32

fileInfoGetAttributeUint32 Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m Word32 | Returns: an unsigned 32-bit integer from the attribute.

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.

## getAttributeUint64

fileInfoGetAttributeUint64 Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m Word64 | Returns: a unsigned 64-bit integer from the attribute.

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.

## getContentType

fileInfoGetContentType Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m (Maybe Text) | Returns: a string containing the file's content type, or `Nothing` if unknown.

Gets the file's content type.

## getDeletionDate

fileInfoGetDeletionDate Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m (Maybe DateTime) | Returns: a `DateTime`, or `Nothing`.

Returns the `DateTime` 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, `Nothing` is returned.

Since: 2.36

## getDisplayName

fileInfoGetDisplayName Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m Text | Returns: a string containing the display name.

Gets a display name for a file. This is guaranteed to always be set.

## getEditName

fileInfoGetEditName Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m Text | Returns: a string containing the edit name.

Gets the edit name for a file.

## getEtag

fileInfoGetEtag Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m Text | Returns: a string containing the value of the "etag:value" attribute.

Gets the [entity tag][gfile-etag] for a given `FileInfo`. See `FILE_ATTRIBUTE_ETAG_VALUE`.

## getFileType

fileInfoGetFileType Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m FileType | Returns: a `FileType` for the given file.

Gets a file's type (whether it is a regular file, symlink, etc). This is different from the file's content type, see `fileInfoGetContentType`.

## getIcon

fileInfoGetIcon Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m Icon | Returns: `Icon` for the given `info`.

Gets the icon for a file.

## getIsBackup

fileInfoGetIsBackup Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m Bool | Returns: `True` if file is a backup file, `False` otherwise.

Checks if a file is a backup file.

## getIsHidden

fileInfoGetIsHidden Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m Bool | Returns: `True` if the file is a hidden file, `False` otherwise.

Checks if a file is hidden.

## getIsSymlink

fileInfoGetIsSymlink Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m Bool | Returns: `True` if the given `info` is a symlink.

Checks if a file is a symlink.

## getModificationDateTime

fileInfoGetModificationDateTime Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m (Maybe DateTime) | Returns: modification time, or `Nothing` if unknown

Gets the modification time of the current `info` and returns it as a `DateTime`.

This requires the `FILE_ATTRIBUTE_TIME_MODIFIED` attribute. If `FILE_ATTRIBUTE_TIME_MODIFIED_USEC` is provided, the resulting `DateTime` will have microsecond precision.

Since: 2.62

## getModificationTime

fileInfoGetModificationTime Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m TimeVal |

Deprecated: (Since version 2.62)Use `fileInfoGetModificationDateTime` instead, as `TimeVal` is deprecated due to the year 2038 problem.

Gets the modification time of the current `info` and sets it in `result`.

## getName

fileInfoGetName Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m [Char] | Returns: a string containing the file name.

Gets the name for a file. This is guaranteed to always be set.

## getSize

fileInfoGetSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m Int64 | Returns: a `goffset` containing the file's size.

Gets the file's size.

## getSortOrder

fileInfoGetSortOrder Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m Int32 | Returns: a `gint32` containing the value of the "standard[sort_order](#g:signal:sort_order)" attribute.

Gets the value of the sort_order attribute from the `FileInfo`. See `FILE_ATTRIBUTE_STANDARD_SORT_ORDER`.

## getSymbolicIcon

fileInfoGetSymbolicIcon Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m Icon | Returns: `Icon` for the given `info`.

Gets the symbolic icon for a file.

Since: 2.34

## getSymlinkTarget

fileInfoGetSymlinkTarget Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> m Text | Returns: a string containing the symlink target.

Gets the symlink target for a given `FileInfo`.

## hasAttribute

fileInfoHasAttribute Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m Bool | Returns: `True` if `info` has an attribute named `attribute`, `False` otherwise.

Checks if a file info structure has an attribute named `attribute`.

## hasNamespace

fileInfoHasNamespace Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `nameSpace`: a file attribute namespace.
-> m Bool | Returns: `True` if `info` has an attribute in `nameSpace`, `False` otherwise.

Checks if a file info structure has an attribute in the specified `nameSpace`.

Since: 2.22

## listAttributes

fileInfoListAttributes Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Maybe Text | `nameSpace`: a file attribute key's namespace, or `Nothing` to list all attributes.
-> m (Maybe [Text]) | Returns: a null-terminated array of strings of all of the possible attribute types for the given `nameSpace`, or `Nothing` on error.

Lists the file info structure's attributes.

## new

fileInfoNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m FileInfo | Returns: a `FileInfo`.

Creates a new file info structure.

## removeAttribute

fileInfoRemoveAttribute Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> m () |

Removes all cases of `attribute` from `info` if it exists.

## setAttribute

fileInfoSetAttribute Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> FileAttributeType | `type`: a `FileAttributeType`
-> Ptr () | `valueP`: pointer to the value
-> m () |

Sets the `attribute` to contain the given value, if possible. To unset the attribute, use `FileAttributeTypeInvalid` for `type`.

## setAttributeBoolean

fileInfoSetAttributeBoolean Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> Bool | `attrValue`: a boolean value.
-> m () |

Sets the `attribute` to contain the given `attrValue`, if possible.

## setAttributeByteString

fileInfoSetAttributeByteString Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> Text | `attrValue`: a byte string.
-> m () |

Sets the `attribute` to contain the given `attrValue`, if possible.

## setAttributeInt32

fileInfoSetAttributeInt32 Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> Int32 | `attrValue`: a signed 32-bit integer
-> m () |

Sets the `attribute` to contain the given `attrValue`, if possible.

## setAttributeInt64

fileInfoSetAttributeInt64 Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: attribute name to set.
-> Int64 | `attrValue`: int64 value to set attribute to.
-> m () |

Sets the `attribute` to contain the given `attrValue`, if possible.

## setAttributeMask

fileInfoSetAttributeMask Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> FileAttributeMatcher | `mask`: a `FileAttributeMatcher`.
-> m () |

Sets `mask` on `info` to match specific attribute types.

## setAttributeObject

fileInfoSetAttributeObject Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a, IsObject b) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> b | `attrValue`: a `Object`.
-> m () |

Sets the `attribute` to contain the given `attrValue`, if possible.

## setAttributeStatus

fileInfoSetAttributeStatus Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`
-> Text | `attribute`: a file attribute key
-> FileAttributeStatus | `status`: a `FileAttributeStatus`
-> m Bool | Returns: `True` if the status was changed, `False` if the key was not set.

Sets the attribute status for an attribute key. This is only needed by external code that implement `fileSetAttributesFromInfo` or similar functions.

The attribute must exist in `info` for this to work. Otherwise `False` is returned and `info` is unchanged.

Since: 2.22

## setAttributeString

fileInfoSetAttributeString Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> Text | `attrValue`: a UTF-8 string.
-> m () |

Sets the `attribute` to contain the given `attrValue`, if possible.

## setAttributeStringv

fileInfoSetAttributeStringv Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key
-> [Text] | `attrValue`: a `Nothing` terminated array of UTF-8 strings.
-> m () |

Sets the `attribute` to contain the given `attrValue`, if possible.

Sinze: 2.22

## setAttributeUint32

fileInfoSetAttributeUint32 Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> Word32 | `attrValue`: an unsigned 32-bit integer.
-> m () |

Sets the `attribute` to contain the given `attrValue`, if possible.

## setAttributeUint64

fileInfoSetAttributeUint64 Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `attribute`: a file attribute key.
-> Word64 | `attrValue`: an unsigned 64-bit integer.
-> m () |

Sets the `attribute` to contain the given `attrValue`, if possible.

## setContentType

fileInfoSetContentType Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `contentType`: a content type. See [GContentType][gio-GContentType]
-> m () |

Sets the content type attribute for a given `FileInfo`. See `FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE`.

## setDisplayName

fileInfoSetDisplayName Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `displayName`: a string containing a display name.
-> m () |

Sets the display name for the current `FileInfo`. See `FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME`.

## setEditName

fileInfoSetEditName Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `editName`: a string containing an edit name.
-> m () |

Sets the edit name for the current file. See `FILE_ATTRIBUTE_STANDARD_EDIT_NAME`.

## setFileType

fileInfoSetFileType Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> FileType | `type`: a `FileType`.
-> m () |

Sets the file type in a `FileInfo` to `type`. See `FILE_ATTRIBUTE_STANDARD_TYPE`.

## setIcon

fileInfoSetIcon Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a, IsIcon b) |
=> a | `info`: a `FileInfo`.
-> b | `icon`: a `Icon`.
-> m () |

Sets the icon for a given `FileInfo`. See `FILE_ATTRIBUTE_STANDARD_ICON`.

## setIsHidden

fileInfoSetIsHidden Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Bool | `isHidden`: a `Bool`.
-> m () |

Sets the "is_hidden" attribute in a `FileInfo` according to `isHidden`. See `FILE_ATTRIBUTE_STANDARD_IS_HIDDEN`.

## setIsSymlink

fileInfoSetIsSymlink Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Bool | `isSymlink`: a `Bool`.
-> m () |

Sets the "is_symlink" attribute in a `FileInfo` according to `isSymlink`. See `FILE_ATTRIBUTE_STANDARD_IS_SYMLINK`.

## setModificationDateTime

fileInfoSetModificationDateTime Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> DateTime | `mtime`: a `DateTime`.
-> m () |

Sets the `FILE_ATTRIBUTE_TIME_MODIFIED` and `FILE_ATTRIBUTE_TIME_MODIFIED_USEC` attributes in the file info to the given date/time value.

Since: 2.62

## setModificationTime

fileInfoSetModificationTime Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> TimeVal | `mtime`: a `TimeVal`.
-> m () |

Deprecated: (Since version 2.62)Use `fileInfoSetModificationDateTime` instead, as `TimeVal` is deprecated due to the year 2038 problem.

Sets the `FILE_ATTRIBUTE_TIME_MODIFIED` and `FILE_ATTRIBUTE_TIME_MODIFIED_USEC` attributes in the file info to the given time value.

## setName

fileInfoSetName Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> [Char] | `name`: a string containing a name.
-> m () |

Sets the name attribute for the current `FileInfo`. See `FILE_ATTRIBUTE_STANDARD_NAME`.

## setSize

fileInfoSetSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Int64 | `size`: a `goffset` containing the file's size.
-> m () |

Sets the `FILE_ATTRIBUTE_STANDARD_SIZE` attribute in the file info to the given size.

## setSortOrder

fileInfoSetSortOrder Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Int32 | `sortOrder`: a sort order integer.
-> m () |

Sets the sort order attribute in the file info structure. See `FILE_ATTRIBUTE_STANDARD_SORT_ORDER`.

## setSymbolicIcon

fileInfoSetSymbolicIcon Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a, IsIcon b) |
=> a | `info`: a `FileInfo`.
-> b | `icon`: a `Icon`.
-> m () |

Sets the symbolic icon for a given `FileInfo`. See `FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON`.

Since: 2.34

## setSymlinkTarget

fileInfoSetSymlinkTarget Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: a `FileInfo`.
-> Text | `symlinkTarget`: a static string containing a path to a symlink target.
-> m () |

Sets the `FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET` attribute in the file info to the given symlink target.

## unsetAttributeMask

fileInfoUnsetAttributeMask Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInfo a) |
=> a | `info`: `FileInfo`.
-> m () |

Unsets a mask set by `fileInfoSetAttributeMask`, if one is set.