allocRead : FromBuf a => Bits32 -> (Buffer -> Bits32 -> PrimIO SsizeT) -> EPrim a Converts a number of bytes read into a buffer to a suitable result.
Totality: total
Visibility: exporttoRes : FromBuf a => Bits32 -> (Buffer -> Bits32 -> PrimIO SsizeT) -> EPrim (ReadRes a) Like `allocRead` but treats certain errors as valid results.
Totality: total
Visibility: exportptrRead : FromPtr a => AnyPtr -> PrimIO SsizeT -> EPrim a Converts a number of bytes read into a C-ptr to a suitable result.
Totality: total
Visibility: exportptrToRes : FromPtr a => AnyPtr -> PrimIO SsizeT -> EPrim (ReadRes a) Like `ptrRead` but treats certain errors as valid results.
Totality: total
Visibility: exporttoFD : PrimIO CInt -> EPrim Fd- Totality: total
Visibility: export openFile : String -> Flags -> Mode -> EPrim Fd Tries to open a file with the given flags and mode.
Totality: total
Visibility: exportclose : FileDesc a => a -> EPrim () Closes a file descriptor.
Totality: total
Visibility: exportclose' : FileDesc a => a -> PrimIO () Convenience version of `close` that fails silently.
Totality: total
Visibility: exportreadPtr : FileDesc a => a -> (0 r : Type) -> FromPtr r => CPtr -> EPrim r Reads at most `n` bytes from a file into a pre-allocated pointer.
Totality: total
Visibility: exportreadPtrRes : FileDesc a => a -> (0 r : Type) -> FromPtr r => CPtr -> EPrim (ReadRes r) Reads at most `n` bytes from a file into a pre-allocated pointer.
This is similar to `readres`, but it allows us to efficiently stream
data into a large pointer, even in case the chunks of data are much smaller.
Totality: total
Visibility: exportread : FileDesc a => a -> (0 r : Type) -> FromBuf r => Bits32 -> EPrim r Reads at most `n` bytes from a file into a suitable result type.
Totality: total
Visibility: exportreadRaw : FileDesc a => a -> Buf -> EPrim EMBuffer Reads data from a file into a preallocated buffer
Totality: total
Visibility: exportreadres : FileDesc a => a -> (0 r : Type) -> FromBuf r => Bits32 -> EPrim (ReadRes r) Reads at most `n` bytes from a file into a suitable result type.
This is a more convenient version of `read` that gives detailed
information about why a read might fail. It is especially useful
when reading from - possibly non-blocking - pipes or sockets.
Totality: total
Visibility: exportpread : FileDesc a => a -> (0 r : Type) -> FromBuf r => Bits32 -> OffT -> EPrim r Atomically reads up to `n` bytes from the given file at
the given file offset.
Notes: This will only work with seekable files but not with
arbitrary data streams such as pipes or sockets.
Also, it will not change the position of the open file description.
Totality: total
Visibility: exportwrite : FileDesc a => a -> ToBuf r => r -> EPrim Bits32 Writes up to the number of bytes in the bytestring
to the given file.
Note: This is an atomic operation if `fd` is a regular file that
was opened in "append" mode (with the `O_APPEND` flag).
Totality: total
Visibility: exportfwrite : FileDesc a => a -> ToBuf r => r -> EPrim () Iteratively writes a value to a file descriptor making sure
that the whole value is written. Use this, if a single call to
`write` might not write the complete data (for instance, when
writing to a pipe or socket).
Totality: total
Visibility: exportpwrite : FileDesc a => a -> ToBuf r => r -> OffT -> EPrim Bits32 Atomically writes up to the number of bytes in the bytestring
to the given file at the given file offset.
Notes: This will only work with seekable files but not with
arbitrary data streams such as pipes or sockets.
Also, it will not change the position of the open file description.
Totality: total
Visibility: exportlseek : FileDesc a => a -> OffT -> Whence -> PrimIO OffT Moves the file pointer to the given offset relative to the
`Whence` value.
Totality: total
Visibility: exportdup : FileDesc a => a -> EPrim Fd Duplicates the given open file descriptor.
The duplicate is guaranteed to be given the smallest available
file descriptor.
Totality: total
Visibility: exportdup2 : FileDesc a => a -> FileDesc b => b -> EPrim Fd Duplicates the given open file descriptor.
The new file descriptor vill have the integer value of `fd2`.
This is an atomic operation that will close `fd2` if it is still open.
Totality: total
Visibility: exportdupfd : FileDesc a => a -> Bits32 -> EPrim Fd Duplicates the given open file descriptor.
The new file descriptor vill have the integer value of `fd2`.
This is an atomic operation that will close `fd2` if it is still open.
Totality: total
Visibility: exportgetFlags : FileDesc a => a -> EPrim Flags Gets the flags set at an open file descriptor.
Totality: total
Visibility: exportsetFlags : FileDesc a => a -> Flags -> EPrim () Sets the flags of an open file descriptor.
Note: This replaces the currently set flags. See also `addFlags`.
Totality: total
Visibility: exportaddFlags : FileDesc a => a -> Flags -> EPrim () Adds the given flags to the flags set for an open
file descriptor by ORing them with the currently set flags.
Totality: total
Visibility: exportftruncate : FileDesc a => a -> OffT -> EPrim () Truncates a file to the given length.
Totality: total
Visibility: exporttruncate : String -> OffT -> EPrim () Truncates a file to the given length.
Totality: total
Visibility: exportmkstemp : String -> EPrim (Fd, String) Atomically creates and opens a temporary, unique file.
Totality: total
Visibility: exportlink : String -> String -> EPrim () Creates a (hard) link to a file.
Totality: total
Visibility: exportsymlink : String -> String -> EPrim () Creates a (hard) link to a file.
Totality: total
Visibility: exportunlink : String -> EPrim () Deletes a (hard) link to a file.
If this is the last link to the file, the file is removed.
Note: Files with open file descriptors will only be deleted after the last
open file descriptor is closed, but the file name will already
disapper from the file system before that.
Totality: total
Visibility: exportremove : String -> EPrim () Removes a file or (empty) directory calling `unlink` or `rmdir`
internally.
Totality: total
Visibility: exportrename : String -> String -> EPrim () Renames a file within a file system.
Note: This will fail if the two paths point to different file systems.
In that case, the file needs to be copied from one FS to the other.
Totality: total
Visibility: exportreadlink : FromBuf a => String -> EPrim a Returns the path of a file a symbolic link points to
This allocates a buffer of 4096 bytes for the byte array holding
the result.
Totality: total
Visibility: exportstdout : String -> PrimIO ()- Totality: total
Visibility: export stdoutLn : String -> PrimIO ()- Totality: total
Visibility: export prnt : Show a => a -> PrimIO ()- Totality: total
Visibility: export prntLn : Show a => a -> PrimIO ()- Totality: total
Visibility: export stderr : String -> PrimIO ()- Totality: total
Visibility: export stderrLn : String -> PrimIO ()- Totality: total
Visibility: export