gi-gio-2.0.38: Gio bindings

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

GI.Gio.Objects.FileInfo

Contents

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

Description

Stores information about a file system object referenced by a `File`.

Functionality for manipulating basic metadata for files. `GFileInfo` implements methods for getting information that all files should contain, and allows for manipulation of extended attributes.

See the file attributes document for more information on how GIO handles file attributes.

To obtain a `GFileInfo` for a `File`, use `fileQueryInfo` (or its async variant). To obtain a `GFileInfo` 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 `GFileInfo` 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.

The direct accessors, such as `fileInfoGetName`, are slightly more optimized than the generic attribute accessors, such as `fileInfoGetAttributeByteString`.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 `GFileInfo`. Use `fileInfoHasAttribute` or `fileInfoListAttributes` to check what attributes are specified for a `GFileInfo`.

`FileAttributeMatcher` allows for searching through a `GFileInfo` 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
- fileInfoGetAccessDateTime :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m (Maybe DateTime)
- 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)
- fileInfoGetAttributeFilePath :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> m (Maybe [Char])
- 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)
- fileInfoGetCreationDateTime :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m (Maybe DateTime)
- 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 (Maybe Text)
- fileInfoGetFileType :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m FileType
- fileInfoGetIcon :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m (Maybe 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 (Maybe Icon)
- fileInfoGetSymlinkTarget :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> m (Maybe [Char])
- 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 ()
- fileInfoSetAccessDateTime :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> DateTime -> 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 ()
- fileInfoSetAttributeFilePath :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> Text -> [Char] -> 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 ()
- fileInfoSetCreationDateTime :: (HasCallStack, MonadIO m, IsFileInfo a) => a -> DateTime -> 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 -> [Char] -> 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 Source # (/=) :: FileInfo -> FileInfo -> Bool Source #
GObject FileInfo Source # |
Instance details Defined in GI.Gio.Objects.FileInfo
ManagedPtrNewtype FileInfo Source # |
Instance details Defined in GI.Gio.Objects.FileInfo Methods toManagedPtr :: FileInfo -> ManagedPtr FileInfo Source #
TypedObject FileInfo Source # |
Instance details Defined in GI.Gio.Objects.FileInfo Methods glibType :: IO GType Source #
HasParentTypes FileInfo Source # |
Instance details Defined in GI.Gio.Objects.FileInfo
IsGValue (Maybe FileInfo) Source # | Convert `FileInfo` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gio.Objects.FileInfo Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe FileInfo -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe FileInfo) Source #
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

### Click to display all available methods, including inherited ones

Expand

#### Methods

bindProperty, bindPropertyFull, clearStatus, copyInto, dup, forceFloating, freezeNotify, getv, hasAttribute, hasNamespace, isFloating, listAttributes, notify, notifyByPspec, ref, refSink, removeAttribute, runDispose, stealData, stealQdata, thawNotify, unref, unsetAttributeMask, watchClosure.

#### Getters

getAccessDateTime, getAttributeAsString, getAttributeBoolean, getAttributeByteString, getAttributeData, getAttributeFilePath, getAttributeInt32, getAttributeInt64, getAttributeObject, getAttributeStatus, getAttributeString, getAttributeStringv, getAttributeType, getAttributeUint32, getAttributeUint64, getContentType, getCreationDateTime, getData, getDeletionDate, getDisplayName, getEditName, getEtag, getFileType, getIcon, getIsBackup, getIsHidden, getIsSymlink, getModificationDateTime, getModificationTime, getName, getProperty, getQdata, getSize, getSortOrder, getSymbolicIcon, getSymlinkTarget.

#### Setters

setAccessDateTime, setAttribute, setAttributeBoolean, setAttributeByteString, setAttributeFilePath, setAttributeInt32, setAttributeInt64, setAttributeMask, setAttributeObject, setAttributeStatus, setAttributeString, setAttributeStringv, setAttributeUint32, setAttributeUint64, setContentType, setCreationDateTime, setData, setDataFull, setDisplayName, setEditName, setFileType, setIcon, setIsHidden, setIsSymlink, setModificationDateTime, setModificationTime, setName, setProperty, setSize, setSortOrder, setSymbolicIcon, setSymlinkTarget.

## 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 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.

## getAccessDateTime

fileInfoGetAccessDateTime Source #

Arguments

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

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

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_TIME_ACCESS`. If `FILE_ATTRIBUTE_TIME_ACCESS_USEC` is provided, the resulting `DateTime` will additionally have microsecond precision.

If nanosecond precision is needed, `FILE_ATTRIBUTE_TIME_ACCESS_NSEC` must be queried separately using `fileInfoGetAttributeUint32`.

Since: 2.70

## 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 an attribute, formatted as a human readable string.

This escapes things as needed to make the string valid UTF-8 and readable by humans. It’s not meant to be a machine readable or reversible escaping format.

To format file name attributes of type `FileAttributeTypeByteString` for output as UTF-8, use `filenameToUtf8` instead:

### c code

    const char *trash_orig_path_byte_string;
    g_autofree char *trash_orig_path_utf8 = NULL;

    trash_orig_path_byte_string = g_file_info_get_attribute_byte_string (info, G_FILE_ATTRIBUTE_TRASH_ORIG_PATH);
    trash_orig_path_utf8 = g_filename_to_utf8 (trash_orig_path_byte_string, -1, NULL, NULL, NULL);
    if (trash_orig_path_utf8 != NULL)
      g_message ("Some larger UTF-8 string with filename embedded as %s", trash_orig_path_utf8);

## 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.

## getAttributeFilePath

fileInfoGetAttributeFilePath Source #

Arguments

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

Gets the value of a byte string attribute as a file path.

If the attribute does not contain a byte string, `NULL` will be returned.

This function is meant to be used by language bindings that have specific handling for Unix paths.

Since: 2.78

## 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.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE`.

## getCreationDateTime

fileInfoGetCreationDateTime Source #

Arguments

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

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

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_TIME_CREATED`. If `FILE_ATTRIBUTE_TIME_CREATED_USEC` is provided, the resulting `DateTime` will additionally have microsecond precision.

If nanosecond precision is needed, `FILE_ATTRIBUTE_TIME_CREATED_NSEC` must be queried separately using `fileInfoGetAttributeUint32`.

Since: 2.70

## 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 `FILE_ATTRIBUTE_TRASH_DELETION_DATE`. If the `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.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME`.

## 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.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_EDIT_NAME`.

## getEtag

fileInfoGetEtag Source #

Arguments

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

Gets the [entity tag][iface`gio`.File`entity`-tags] for a given `FileInfo`. See `FILE_ATTRIBUTE_ETAG_VALUE`.

It is an error to call this if the `FileInfo` does not contain `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`.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_TYPE`.

## getIcon

fileInfoGetIcon Source #

Arguments

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

Gets the icon for a file.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_ICON`.

## 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.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_IS_BACKUP`.

## 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.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_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.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_IS_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`.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_TIME_MODIFIED`. If `FILE_ATTRIBUTE_TIME_MODIFIED_USEC` is provided, the resulting `DateTime` will additionally have microsecond precision.

If nanosecond precision is needed, `FILE_ATTRIBUTE_TIME_MODIFIED_NSEC` must be queried separately using `fileInfoGetAttributeUint32`.

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`.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_TIME_MODIFIED`. If `FILE_ATTRIBUTE_TIME_MODIFIED_USEC` is provided it will be used too.

## 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.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_NAME`.

## getSize

fileInfoGetSize Source #

Arguments

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

Gets the file's size (in bytes). The size is retrieved through the value of the `FILE_ATTRIBUTE_STANDARD_SIZE` attribute and is converted from `guint64` to `goffset` before returning the result.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_SIZE`.

## getSortOrder

fileInfoGetSortOrder Source #

Arguments

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

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

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_SORT_ORDER`.

## getSymbolicIcon

fileInfoGetSymbolicIcon Source #

Arguments

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

Gets the symbolic icon for a file.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON`.

Since: 2.34

## getSymlinkTarget

fileInfoGetSymlinkTarget Source #

Arguments

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

Gets the symlink target for a given `FileInfo`.

It is an error to call this if the `FileInfo` does not contain `FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET`.

## 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.

## setAccessDateTime

fileInfoSetAccessDateTime Source #

Arguments

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

Sets the `FILE_ATTRIBUTE_TIME_ACCESS` and `FILE_ATTRIBUTE_TIME_ACCESS_USEC` attributes in the file info to the given date/time value.

`FILE_ATTRIBUTE_TIME_ACCESS_NSEC` will be cleared.

Since: 2.70

## 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.

## setAttributeFilePath

fileInfoSetAttributeFilePath Source #

Arguments

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

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

This function is meant to be used by language bindings that have specific handling for Unix paths.

Since: 2.78

## 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.
-> m () |

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

## setCreationDateTime

fileInfoSetCreationDateTime Source #

Arguments

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

Sets the `FILE_ATTRIBUTE_TIME_CREATED` and `FILE_ATTRIBUTE_TIME_CREATED_USEC` attributes in the file info to the given date/time value.

`FILE_ATTRIBUTE_TIME_CREATED_NSEC` will be cleared.

Since: 2.70

## 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.

`FILE_ATTRIBUTE_TIME_MODIFIED_NSEC` will be cleared.

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.

`FILE_ATTRIBUTE_TIME_MODIFIED_NSEC` will be cleared.

## 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`.
-> [Char] | `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.