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