W3cubDocs

/Haskell 7

System.Posix.Directory.ByteString

Copyright (c) The University of Glasgow 2002
License BSD-style (see the file libraries/base/LICENSE)
Maintainer [email protected]
Stability provisional
Portability non-portable (requires POSIX)
Safe Haskell Trustworthy
Language Haskell2010

Description

String-based POSIX directory support

Creating and removing directories

createDirectory :: RawFilePath -> FileMode -> IO () Source

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

removeDirectory :: RawFilePath -> IO () Source

Reading directories

data DirStream Source

openDirStream :: RawFilePath -> IO DirStream Source

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

readDirStream :: DirStream -> IO RawFilePath 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.

data DirStreamOffset Source

tellDirStream :: DirStream -> IO DirStreamOffset Source

seekDirStream :: DirStream -> DirStreamOffset -> IO () Source

The working dirctory

getWorkingDirectory :: IO RawFilePath Source

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

changeWorkingDirectory :: RawFilePath -> IO () Source

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

changeWorkingDirectoryFd :: Fd -> IO () Source

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/7.10.3/docs/html/libraries/unix-2.7.1.0/System-Posix-Directory-ByteString.html