pathtype-0.8.1.1: Type-safe replacement for System.FilePath etc

Safe HaskellSafe
LanguageHaskell98

System.Path.Directory

Contents

Description

This module provides type-safe access to directory manipulations.

It is designed to be imported instead of System.Directory. (It is intended to provide versions of functions from that module which have equivalent functionality but are more typesafe). System.Path is a companion module providing a type-safe alternative to System.FilePath.

You will typically want to import as follows:

import Prelude hiding (FilePath)
import System.Path
import System.Path.Directory
import System.Path.IO

Ben Moseley - (c) 2009

Synopsis

Actions on directories

renameDirectory :: (AbsRel ar1, AbsRel ar2) => DirPath ar1 -> DirPath ar2 -> IO () Source #

getDirectoryContents :: AbsRel ar => DirPath ar -> IO [RelFileDir] Source #

Retrieve the contents of a directory without any directory prefixes. In contrast to getDirectoryContents, exclude special directories "." and "..".

absDirectoryContents :: AbsRel ar => DirPath ar -> IO ([AbsDir], [AbsFile]) Source #

Retrieve the contents of a directory path (which may be relative) as absolute paths

relDirectoryContents :: AbsRel ar => DirPath ar -> IO ([RelDir], [RelFile]) Source #

Returns paths relative to the supplied (abs or relative) directory path. eg (for current working directory of /somewhere/cwd/):

show (relDirectoryContents "d/e/f/") == (["subDir1A","subDir1B"],
                                                     ["file1A","file1B"])

filesInDir :: AbsRel ar => DirPath ar -> IO [RelFile] Source #

A convenient alternative to relDirectoryContents if you only want files.

dirsInDir :: AbsRel ar => DirPath ar -> IO [RelDir] Source #

A convenient alternative to relDirectoryContents if you only want directories.

Pre-defined directories

Actions on files

removeFile :: AbsRel ar => FilePath ar -> IO () Source #

renameFile :: (AbsRel ar1, AbsRel ar2) => FilePath ar1 -> FilePath ar2 -> IO () Source #

copyFile :: (AbsRel ar1, AbsRel ar2) => FilePath ar1 -> FilePath ar2 -> IO () Source #

canonicalizePath :: (AbsRel ar, FileDir fd) => Path ar fd -> IO (AbsPath fd) Source #

Existence tests

Permissions

setPermissions :: (AbsRel ar, FileDir fd) => Path ar fd -> Permissions -> IO () Source #

Timestamps