StringIO
This module contains file I/O related functions that read and
write contents of textual files into/from String instances.
Reading
readLines :: String -> <Proc> [String]
Reads all lines of the file whose name is given as a parameter.
The file contents are expected to be UTF8 encoded.
readLinesWithCharset :: String -> String -> <Proc> [String]
readLinesWithCharset "charset" "file" reads all lines of the file whose name is given as a parameter using the given charset.
readContentsWithCharset :: String -> String -> <Proc> String
readContentsWithCharset "charset" "file" reads all lines of the file whose name is given as a parameter using the given charset.
Writing
writeLines :: String -> [String] -> <Proc> ()
Creates a new file with the given file name whose contents are the given lines.
The written file will be UTF8 encoded.
appendLine :: String -> String -> <Proc> ()
appendLine fileName line appends line to the file with name fileName
The appended content will be UTF8 encoded.
|