Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
- 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
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 attributes file-attributes.html 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
.
- struct
gio
.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
Memory-managed wrapper type.
Instances
Eq FileInfo Source # | |
GObject FileInfo Source # | |
Defined in GI.Gio.Objects.FileInfo | |
ManagedPtrNewtype FileInfo Source # | |
Defined in GI.Gio.Objects.FileInfo toManagedPtr :: FileInfo -> ManagedPtr FileInfo # | |
TypedObject FileInfo Source # | |
Defined in GI.Gio.Objects.FileInfo | |
HasParentTypes FileInfo Source # | |
Defined in GI.Gio.Objects.FileInfo | |
IsGValue (Maybe FileInfo) Source # | Convert |
Defined in GI.Gio.Objects.FileInfo | |
type ParentTypes FileInfo Source # | |
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
(GObject o, IsDescendantOf FileInfo o) => IsFileInfo o Source # | |
Defined in GI.Gio.Objects.FileInfo |
toFileInfo :: (MonadIO m, IsFileInfo o) => o -> m FileInfo Source #
Methods
Click to display all available methods, including inherited ones
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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m () |
Clears the status information from info
.
copyInto
:: (HasCallStack, MonadIO m, IsFileInfo a, IsFileInfo b) | |
=> a |
|
-> b |
|
-> m () |
First clears all of the [GFileAttribute][gio-GFileAttribute] of destInfo
,
and then copies all of the file attributes from srcInfo
to destInfo
.
dup
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m FileInfo | Returns: a duplicate |
Duplicates a file info structure.
getAccessDateTime
fileInfoGetAccessDateTime Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m (Maybe DateTime) | Returns: access time, or |
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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m (Maybe Text) | Returns: a UTF-8 string associated with the given |
Gets the value of an attribute, formatted as a string. This escapes things as needed to make the string valid UTF-8.
getAttributeBoolean
fileInfoGetAttributeBoolean Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m (Maybe Text) | Returns: the contents of the |
Gets the value of a byte string attribute. If the attribute does
not contain a byte string, Nothing
will be returned.
getAttributeData
fileInfoGetAttributeData Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m (Bool, FileAttributeType, Ptr (), FileAttributeStatus) | Returns: |
Gets the attribute type, value and status for an attribute key.
getAttributeFilePath
fileInfoGetAttributeFilePath Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m (Maybe [Char]) | Returns: the contents of the |
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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m (Maybe Object) | Returns: a |
getAttributeStatus
fileInfoGetAttributeStatus Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m FileAttributeStatus | Returns: a |
Gets the attribute status for an attribute key.
getAttributeString
fileInfoGetAttributeString Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m (Maybe Text) | Returns: the contents of the |
Gets the value of a string attribute. If the attribute does
not contain a string, Nothing
will be returned.
getAttributeStringv
fileInfoGetAttributeStringv Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m (Maybe [Text]) | Returns: the contents of the |
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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m FileAttributeType | Returns: a |
Gets the attribute type for an attribute key.
getAttributeUint32
fileInfoGetAttributeUint32 Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m (Maybe Text) | Returns: a string containing the file's content type,
or |
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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m (Maybe DateTime) | Returns: creation time, or |
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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m (Maybe DateTime) |
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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m (Maybe Text) | Returns: a string containing the value of the "etag:value" attribute. |
Gets the entity tag 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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m FileType | Returns: a |
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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m (Maybe Icon) | Returns: |
Gets the icon for a file.
It is an error to call this if the FileInfo
does not contain
FILE_ATTRIBUTE_STANDARD_ICON
.
getIsBackup
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m Bool |
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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m Bool | Returns: |
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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m Bool | Returns: |
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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m (Maybe DateTime) | Returns: modification time, or |
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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m TimeVal |
Deprecated: (Since version 2.62)Use fileInfoGetModificationDateTime
instead, asTimeVal
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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m Int64 | Returns: a |
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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m Int32 | Returns: a |
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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m (Maybe Icon) | Returns: |
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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: |
Checks if a file info structure has an attribute named attribute
.
hasNamespace
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: |
Checks if a file info structure has an attribute in the
specified nameSpace
.
Since: 2.22
listAttributes
fileInfoListAttributes Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Maybe Text |
|
-> m (Maybe [Text]) | Returns: a
null-terminated array of strings of all of the possible attribute
types for the given |
Lists the file info structure's attributes.
new
:: (HasCallStack, MonadIO m) | |
=> m FileInfo | Returns: a |
Creates a new file info structure.
removeAttribute
fileInfoRemoveAttribute Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m () |
Removes all cases of attribute
from info
if it exists.
setAccessDateTime
fileInfoSetAccessDateTime Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> 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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> FileAttributeType |
|
-> Ptr () |
|
-> m () |
Sets the attribute
to contain the given value, if possible. To unset the
attribute, use FileAttributeTypeInvalid
for type
.
setAttributeBoolean
fileInfoSetAttributeBoolean Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> Bool |
|
-> m () |
Sets the attribute
to contain the given attrValue
,
if possible.
setAttributeByteString
fileInfoSetAttributeByteString Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m () |
Sets the attribute
to contain the given attrValue
,
if possible.
setAttributeFilePath
fileInfoSetAttributeFilePath Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> [Char] |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> m () |
Sets the attribute
to contain the given attrValue
,
if possible.
setAttributeInt64
fileInfoSetAttributeInt64 Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> Int64 |
|
-> m () |
Sets the attribute
to contain the given attrValue
,
if possible.
setAttributeMask
fileInfoSetAttributeMask Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> FileAttributeMatcher |
|
-> m () |
Sets mask
on info
to match specific attribute types.
setAttributeObject
fileInfoSetAttributeObject Source #
:: (HasCallStack, MonadIO m, IsFileInfo a, IsObject b) | |
=> a |
|
-> Text |
|
-> b |
|
-> m () |
Sets the attribute
to contain the given attrValue
,
if possible.
setAttributeStatus
fileInfoSetAttributeStatus Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> FileAttributeStatus |
|
-> m Bool | Returns: |
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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m () |
Sets the attribute
to contain the given attrValue
,
if possible.
setAttributeStringv
fileInfoSetAttributeStringv Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> [Text] |
|
-> m () |
Sets the attribute
to contain the given attrValue
,
if possible.
Sinze: 2.22
setAttributeUint32
fileInfoSetAttributeUint32 Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> Word32 |
|
-> m () |
Sets the attribute
to contain the given attrValue
,
if possible.
setAttributeUint64
fileInfoSetAttributeUint64 Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> Word64 |
|
-> m () |
Sets the attribute
to contain the given attrValue
,
if possible.
setContentType
fileInfoSetContentType Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the content type attribute for a given FileInfo
.
See FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE
.
setCreationDateTime
fileInfoSetCreationDateTime Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> 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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the display name for the current FileInfo
.
See FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
.
setEditName
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the edit name for the current file.
See FILE_ATTRIBUTE_STANDARD_EDIT_NAME
.
setFileType
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> FileType |
|
-> m () |
Sets the file type in a FileInfo
to type
.
See FILE_ATTRIBUTE_STANDARD_TYPE
.
setIcon
:: (HasCallStack, MonadIO m, IsFileInfo a, IsIcon b) | |
=> a |
|
-> b |
|
-> m () |
Sets the icon for a given FileInfo
.
See FILE_ATTRIBUTE_STANDARD_ICON
.
setIsHidden
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets the "is_hidden" attribute in a FileInfo
according to isHidden
.
See FILE_ATTRIBUTE_STANDARD_IS_HIDDEN
.
setIsSymlink
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets the "is_symlink" attribute in a FileInfo
according to isSymlink
.
See FILE_ATTRIBUTE_STANDARD_IS_SYMLINK
.
setModificationDateTime
fileInfoSetModificationDateTime Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> 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 #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> TimeVal |
|
-> m () |
Deprecated: (Since version 2.62)Use fileInfoSetModificationDateTime
instead, asTimeVal
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
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> [Char] |
|
-> m () |
Sets the name attribute for the current FileInfo
.
See FILE_ATTRIBUTE_STANDARD_NAME
.
setSize
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Int64 |
|
-> m () |
Sets the FILE_ATTRIBUTE_STANDARD_SIZE
attribute in the file info
to the given size.
setSortOrder
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the sort order attribute in the file info structure. See
FILE_ATTRIBUTE_STANDARD_SORT_ORDER
.
setSymbolicIcon
fileInfoSetSymbolicIcon Source #
:: (HasCallStack, MonadIO m, IsFileInfo a, IsIcon b) | |
=> a |
|
-> b |
|
-> m () |
Sets the symbolic icon for a given FileInfo
.
See FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON
.
Since: 2.34
setSymlinkTarget
fileInfoSetSymlinkTarget Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> [Char] |
|
-> m () |
Sets the FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET
attribute in the file info
to the given symlink target.
unsetAttributeMask
fileInfoUnsetAttributeMask Source #
:: (HasCallStack, MonadIO m, IsFileInfo a) | |
=> a |
|
-> m () |
Unsets a mask set by fileInfoSetAttributeMask
, if one
is set.