Idris2Doc : System.Posix.File

System.Posix.File

(source)

Reexports

importpublic Control.Monad.Resource
importpublic Data.Buffer
importpublic Data.Buffer.Core
importpublic Data.ByteString
importpublic Data.ByteVect
importpublic Data.C.Ptr
importpublic System.Posix.Errno
importpublic System.Posix.File.FileDesc
importpublic System.Posix.File.Flags
importpublic System.Posix.File.ReadRes
importpublic System.Posix.File.Whence

Definitions

openFile : HasErrnoes=>EIO1f=>String->Flags->Mode->fesFd
  Tries to open a file with the given flags and mode.

Totality: total
Visibility: export
close' : FileDesca=>HasIOio=>a->io ()
  Convenience version of `close` that fails silently.

Totality: total
Visibility: export
close : FileDesca=>a->HasErrnoes=>EIO1f=>fes ()
  Closes a file descriptor.

Totality: total
Visibility: export
readPtr : FileDesca=>a->HasErrnoes=>EIO1f=> (0r : Type) ->FromPtrr=>CPtr->fesr
  Reads at most `n` bytes from a file into a pre-allocated pointer.

Totality: total
Visibility: export
readPtrRes : FileDesca=>a->HasErrnoes=>EIO1f=> (0r : Type) ->FromPtrr=>CPtr->fes (ReadResr)
  Reads at most `n` bytes from a file into a pre-allocated pointer.

Totality: total
Visibility: export
read : FileDesca=>a->HasErrnoes=>EIO1f=> (0r : Type) ->FromBufr=>Bits32->fesr
  Reads at most `n` bytes from a file into a bytestring.

Totality: total
Visibility: export
readRaw : FileDesca=>a->HasErrnoes=>EIO1f=>Buf->fesEMBuffer
  Reads data from a file into a preallocated buffer

Totality: total
Visibility: export
readres : FileDesca=>a->HasErrnoes=>EIO1f=> (0r : Type) ->FromBufr=>Bits32->fes (ReadResr)
  Reads at most `n` bytes from a file into a bytestring.

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: export
pread : FileDesca=>a->HasErrnoes=>EIO1f=> (0r : Type) ->FromBufr=>Bits32->OffT->fesr
  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: export
write : FileDesca=>a->HasErrnoes=>EIO1f=>ToBufr=>r->fesBits32
  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: export
fwrite : FileDesca=>a->HasErrnoes=>EIO1f=>ToBufr=>r->fes ()
  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: export
pwrite : FileDesca=>a->HasErrnoes=>EIO1f=>ToBufr=>r->OffT->fesBits32
  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: export
lseek : FileDesca=>HasIOio=>a->OffT->Whence->ioOffT
  Moves the file pointer to the given offset relative to the
`Whence` value.

Totality: total
Visibility: export
dup : FileDesca=>a->HasErrnoes=>EIO1f=>fesFd
  Duplicates the given open file descriptor.

The duplicate is guaranteed to be given the smallest available
file descriptor.

Totality: total
Visibility: export
dup2 : FileDesca=>a->HasErrnoes=>EIO1f=>FileDescb=>b->fesFd
  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: export
dupfd : FileDesca=>a->HasErrnoes=>EIO1f=>Bits32->fesFd
  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: export
getFlags : FileDesca=>a->HasErrnoes=>EIO1f=>fesFlags
  Gets the flags set at an open file descriptor.

Totality: total
Visibility: export
setFlags : FileDesca=>a->HasErrnoes=>EIO1f=>Flags->fes ()
  Sets the flags of an open file descriptor.

Note: This replaces the currently set flags. See also `addFlags`.

Totality: total
Visibility: export
addFlags : FileDesca=>a->HasErrnoes=>EIO1f=>Flags->fes ()
  Adds the given flags to the flags set for an open
file descriptor by ORing them with the currently set flags.

Totality: total
Visibility: export
ftruncate : FileDesca=>a->HasErrnoes=>EIO1f=>OffT->fes ()
  Truncates a file to the given length.

Totality: total
Visibility: export
truncate : HasErrnoes=>EIO1f=>String->OffT->fes ()
  Truncates a file to the given length.

Totality: total
Visibility: export
mkstemp : HasErrnoes=>EIO1f=>String->fes (Fd, String)
  Atomically creates and opens a temporary, unique file.

Totality: total
Visibility: export
  Creates a (hard) link to a file.

Totality: total
Visibility: export
  Creates a (hard) link to a file.

Totality: total
Visibility: export
  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: export
remove : HasErrnoes=>EIO1f=>String->fes ()
  Removes a file or (empty) directory calling `unlink` or `rmdir`
internally.

Totality: total
Visibility: export
rename : HasErrnoes=>EIO1f=>String->String->fes ()
  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: export
  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: export
stdout : HasIOio=>String->io ()
Totality: total
Visibility: export
stdoutLn : HasIOio=>String->io ()
Totality: total
Visibility: export
prnt : HasIOio=>Showa=>a->io ()
Totality: total
Visibility: export
prntLn : HasIOio=>Showa=>a->io ()
Totality: total
Visibility: export
stderr : HasIOio=>String->io ()
Totality: total
Visibility: export
stderrLn : HasIOio=>String->io ()
Totality: total
Visibility: export