String
contentsOf : Filename -> IO (Result String String)
Read the contents of a file.
writeContentsTo : Filename -> String -> IO ()
Write contents to a file. The Program will fail if there is a problem.
stat : Filename -> IO (Result String Stats)
Read file stats
{ size : Basics.Int
, atime : Basics.Float
, mtime : Basics.Float
, ctime : Basics.Float
}
File stats
readDir : String -> IO (Result String (List Entry))
Read the contents of a directory.
Directory entry
mkDir : Basics.Bool -> String -> IO ()
Create a dir.
mkdir <recursive> <name>
File Descriptor
open : Filename -> Flag a -> IO (Result String (FD a))
Open a file
flagRead : Flag (Readable (Seekable {}))
Open file for reading. (r
)
An error occurs if the file does not exist. The stream is positioned at the beginning of the file.
flagReadPlus : Flag (Readable (Writable (Seekable {})))
Open file for reading and writing. (r+
)
An exception occurs if the file does not exist. The stream is positioned at the beginning of the file.
flagWrite : Flag (Writable (Seekable {}))
Open file for writing. (w
)
The file is created (if it does not exist) or truncated (if it exists). The stream is positioned at the beginning of the file.
flagWritePlus : Flag (Readable (Writable (Seekable {})))
Open file for reading and writing. (w+
)
The file is created (if it does not exist) or truncated (if it exists). The stream is positioned at the beginning of the file.
flagAppend : Flag (Writable {})
Open file for appending (writing at the end of a file). (a
)
The file is created if it does not exist. The stream is positioned at the end of the file.
flagAppendPlus : Flag (Readable (Writable {}))
Open file for reading and appending. (a+
)
The file is created if it does not exist. The stream is positioned at the end of the file.
read : FD (Readable a) -> IO String
Read a file
write : FD (Writable a) -> String -> IO ()
Write to a file
stdErr : FD (Writable {})
Standard Error
stdIn : FD (Readable {})
Standard In
stdOut : FD (Writable {})
Standard Out