unix-2.8.3.0: POSIX functionality
Copyright(c) The University of Glasgow 2002
LicenseBSD-style (see the file libraries/base/LICENSE)
Maintainerlibraries@haskell.org
Stabilityprovisional
Portabilitynon-portable (requires POSIX)
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.Posix.Directory.PosixPath

Description

PosixPath based POSIX directory support

Synopsis

Creating and removing directories

createDirectory :: PosixPath -> FileMode -> IO () Source #

createDirectory dir mode calls mkdir to create a new directory, dir, with permissions based on mode.

Reading directories

openDirStream :: PosixPath -> IO DirStream Source #

openDirStream dir calls opendir to obtain a directory stream for dir.

readDirStream :: DirStream -> IO PosixPath Source #

readDirStream dp calls readdir to obtain the next directory entry (struct dirent) for the open directory stream dp, and returns the d_name member of that structure.

rewindDirStream :: DirStream -> IO () Source #

rewindDirStream dp calls rewinddir to reposition the directory stream dp at the beginning of the directory.

closeDirStream :: DirStream -> IO () Source #

closeDirStream dp calls closedir to close the directory stream dp.

The working directory

getWorkingDirectory :: IO PosixPath Source #

getWorkingDirectory calls getcwd to obtain the name of the current working directory.

changeWorkingDirectory :: PosixPath -> IO () Source #

changeWorkingDirectory dir calls chdir to change the current working directory to dir.