-
Effekt Library
- io/filesystem
- File
- readFile
- writeFile
- appendFile
- Files
- readFile
- writeFile
- filesystem
- openForReading
- openForWriting
- openForAppending
- read
- write
- close
- mkdir
- openForReading
- openForWriting
- openForAppending
- read
- write
- close
- mkdir
- checkResult
- copy
- main
- io/filesystem Jump to source: libraries/common/io/filesystem.effekt
- File
- readFile
(path: String): String / {Exception[IOError]}
- writeFile
(path: String, contents: String): Unit / {Exception[IOError]}
- appendFile
(path: String, contents: String): Unit / {Exception[IOError]}
- Files
- readFile
(path: String): String / {}
- writeFile
(path: String, contents: String): Unit / {}
- filesystem
[R] { program: => R / {Files} }: R / {Exception[IOError]}
- openForReading
(path: String): File / {Exception[IOError]}
- openForWriting
(path: String): File / {Exception[IOError]}
- openForAppending
(path: String): File / {Exception[IOError]}
- read
(file: File, buffer: ByteArray, offset: Int, size: Int, position: Int): Int / {Exception[IOError]}
- write
(file: File, buffer: ByteArray, offset: Int, size: Int, position: Int): Int / {Exception[IOError]}
- close
(file: File): Unit / {Exception[IOError]}
- mkdir
(path: String): Unit / {Exception[IOError]}
- openForReading
(path: String): Int / {}
- openForWriting
(path: String): Int / {}
- openForAppending
(path: String): Int / {}
- read
(file: Int, buffer: ByteArray, offset: Int, size: Int, position: Int): Int / {}
- write
(file: Int, buffer: ByteArray, offset: Int, size: Int, position: Int): Int / {}
- close
(file: Int): Int / {}
- mkdir
(path: String): Int / {}
- checkResult
(result: Int): Int / {Exception[IOError]}
- copy
(from: String, to: String): Unit / {Files}
- main
Example usage: examples/stdlib/io/filesystem
A file descriptor. Should not be inspected.
Reads a file at given path as utf8 encoded string.
Writes the (utf8 encoded) string `contents` into the specified file.
Appends the (utf8 encoded) string `contents` to the specified file.
An abstract interface applications can program against. Can be interpreted with the `filesystem` handler, or virtualized etc. See example below.
Using the file system via node.js
The buffer must be kept alive by using it after the call
The buffer must be kept alive by using it after the call