Moduleunix-2.8.7.0Haskell2010
System.Posix.Directory.Internals
POSIX directory support (internal module, no PVP guarantees)
- 7 types
- 16 values
- Packageunix-2.8.7.0
- Exports32
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceInternals.hsc
Constructors
Constructors
DirStreamWithPath (a, Ptr CDir)
Convert a DirStreamWithPath to a DirStream. Note that the underlying pointer is shared by both values, hence any modification to the resulting DirStream will also modify the original DirStreamWithPath.
Construct a DirStreamWithPath from a DirStream. Note that the underlying pointer is shared by both values, hence any modification to the pointer of the resulting DirStreamWithPath will also modify the original DirStream.
The value of the d_type field of a dirent struct.
Note that the possible values of that type depend on the filesystem that is
queried. From readdir(3):
Currently, only some filesystems (among them: Btrfs, ext2, ext3, and ext4)
have full support for returning the file type in d_type. All applications
must properly handle a return of DT_UNKNOWN.For example, JFS is a filesystem that does not support d_type;
See https://github.com/haskell/ghcup-hs/issues/766
Furthermore, dirent or the constants represented by the associated pattern
synonyms of this type may not be provided by the underlying platform. In that
case none of those patterns will match and the application must handle that
case accordingly.
The DirType refers to an entry of unknown type.
The DirType refers to an entry that is a named pipe.
The DirType refers to an entry that is a character device.
The DirType refers to an entry that is a directory.
The DirType refers to an entry that is a block device.
The DirType refers to an entry that is a regular file.
The DirType refers to an entry that is a symbolic link.
The DirType refers to an entry that is a socket.
The DirType refers to an entry that is a whiteout.
Checks if this DirType refers to an entry of unknown type.
Checks if this DirType refers to a named pipe entry.
Checks if this DirType refers to a character device entry.
Checks if this DirType refers to a directory entry.
Checks if this DirType refers to a block device entry.
Checks if this DirType refers to a regular file entry.
Checks if this DirType refers to a symbolic link entry.
Checks if this DirType refers to a socket entry.
Checks if this DirType refers to a whiteout entry.
readDirStreamWith f dp calls readdir to obtain the next directory entry
(struct dirent) for the open directory stream dp. If an entry is read,
it passes the pointer to that structure to the provided function f for
processing. It returns the result of that function call wrapped in a Just
if an entry was read and Nothing if the end of the directory stream was
reached.
NOTE: The lifetime of the pointer wrapped in the DirEnt is limited to invocation of the callback and it will be freed automatically after. Do not pass it to the outside world!
A version of readDirStreamWith that takes a pre-allocated pointer in
addition to the other arguments. This pointer is used to store the pointer
to the next directory entry, if there is any. This function is intended for
use cases where you need to read a lot of directory entries and want to
reuse the pointer for each of them. Using for example readDirStream or
readDirStreamWith in this scenario would allocate a new pointer for each
call of these functions.
NOTE: You are responsible for releasing the pointer after you are done.