Posix.IO.Directory

This module provides an API for working with the file system.

Directory Entry

type alias Path =
String
type alias Entry =
{ type_ : FileType
, absolutePath : Path
}
= BlockDevice
| CharacterDevice
| Dir
| FIFO
| File
| Socket
| SymbolicLink

File Stat

stat : Path -> IO String Stat
type alias Stat =
{ type_ : FileType
, mode : Mask
, owner : Int
, group : Int
, size : Int
, lastAccessed : Posix
, lastModified : Posix
, lastStatusChanged : Posix
, createdAt : Posix
, absolutePath : Path
}

Directory Contents

type alias Pattern =
String

File name, dir, glob pattern etc.

list : Pattern -> IO String (List Entry)

Directory Operations

copy : List Pattern -> Path -> IO String ()
rename : Pattern -> Path -> IO String ()
delete : List Pattern -> IO String ()
mkdir : Path -> IO String ()

Permissions

setPermission : Permission -> Pattern -> IO String ()

Set the permission

addPermission : Permission -> Pattern -> IO String ()
removePermission : Permission -> Pattern -> IO String ()