Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
An opaque structure representing an opened directory.
- newtype Dir = Dir (ManagedPtr Dir)
- noDir :: Maybe Dir
- data DirCloseMethodInfo
- dirClose :: (HasCallStack, MonadIO m) => Dir -> m ()
- dirMakeTmp :: (HasCallStack, MonadIO m) => Maybe [Char] -> m [Char]
- data DirReadNameMethodInfo
- dirReadName :: (HasCallStack, MonadIO m) => Dir -> m [Char]
- data DirRewindMethodInfo
- dirRewind :: (HasCallStack, MonadIO m) => Dir -> m ()
Exported types
Dir (ManagedPtr Dir) |
WrappedPtr Dir Source # | |
((~) * info (ResolveDirMethod t Dir), MethodInfo * info Dir p) => IsLabel t (Dir -> p) Source # | |
((~) * info (ResolveDirMethod t Dir), MethodInfo * info Dir p) => IsLabelProxy t (Dir -> p) Source # | |
HasAttributeList * Dir Source # | |
((~) * signature (m ()), MonadIO m) => MethodInfo * DirRewindMethodInfo Dir signature Source # | |
((~) * signature (m [Char]), MonadIO m) => MethodInfo * DirReadNameMethodInfo Dir signature Source # | |
((~) * signature (m ()), MonadIO m) => MethodInfo * DirCloseMethodInfo Dir signature Source # | |
type AttributeList Dir Source # | |
Methods
close
data DirCloseMethodInfo Source #
((~) * signature (m ()), MonadIO m) => MethodInfo * DirCloseMethodInfo Dir signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Dir |
|
-> m () |
Closes the directory and deallocates all related resources.
makeTmp
:: (HasCallStack, MonadIO m) | |
=> Maybe [Char] |
|
-> m [Char] | Returns: The actual name used. This string
should be freed with |
Creates a subdirectory in the preferred directory for temporary
files (as returned by getTmpDir
).
tmpl
should be a string in the GLib file name encoding containing
a sequence of six 'X' characters, as the parameter to mkstemp
.
However, unlike these functions, the template should only be a
basename, no directory components are allowed. If template is
Nothing
, a default template is used.
Note that in contrast to mkdtemp
(and mkdtemp()
) tmpl
is not
modified, and might thus be a read-only literal string.
Since: 2.30
readName
data DirReadNameMethodInfo Source #
((~) * signature (m [Char]), MonadIO m) => MethodInfo * DirReadNameMethodInfo Dir signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Dir |
|
-> m [Char] | Returns: The entry's name or |
Retrieves the name of another entry in the directory, or Nothing
.
The order of entries returned from this function is not defined,
and may vary by file system or other operating-system dependent
factors.
Nothing
may also be returned in case of errors. On Unix, you can
check errno
to find out if Nothing
was returned because of an error.
On Unix, the '.' and '..' entries are omitted, and the returned name is in the on-disk encoding.
On Windows, as is true of all GLib functions which operate on filenames, the returned name is in UTF-8.
rewind
data DirRewindMethodInfo Source #
((~) * signature (m ()), MonadIO m) => MethodInfo * DirRewindMethodInfo Dir signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Dir |
|
-> m () |
Resets the given directory. The next call to dirReadName
will return the first entry again.