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

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

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

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

relDirectoryContents :: AbsRelClass 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 :: AbsRelClass ar => DirPath ar -> IO [RelFile]Source

A convenient alternative to relDirectoryContents if you only want files.

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

A convenient alternative to relDirectoryContents if you only want directories.

Pre-defined directories

Actions on files

Existence tests

Permissions

Timestamps