Idris2Doc : System.UV.Raw.File

System.UV.Raw.File

(source)

Reexports

importpublic System.UV.Data.File

Definitions

dataUV_Timespec_T : Type
Totality: total
Visibility: export
dataStat : Type
Totality: total
Visibility: export
dataStatFs : Type
Totality: total
Visibility: export
dataDir : Type
Totality: total
Visibility: export
dataDirent : Type
Totality: total
Visibility: export
0FsCB : Type
  Alias for a foreign callable code object

Totality: total
Visibility: public export
st_dev : PtrStat->Bits64
st_mode : PtrStat->Bits64
st_uid : PtrStat->Bits64
st_gid : PtrStat->Bits64
st_rdev : PtrStat->Bits64
st_ino : PtrStat->Bits64
st_size : PtrStat->Bits64
st_blksize : PtrStat->Bits64
st_blocks : PtrStat->Bits64
st_flags : PtrStat->Bits64
st_gen : PtrStat->Bits64
st_atim : PtrStat->UV_Timespec_T
st_mtim : PtrStat->UV_Timespec_T
st_ctim : PtrStat->UV_Timespec_T
st_birthtim : PtrStat->UV_Timespec_T
f_type : PtrStatFs->Bits64
f_bsize : PtrStatFs->Bits64
f_blocks : PtrStatFs->Bits64
f_bfree : PtrStatFs->Bits64
f_bavail : PtrStatFs->Bits64
f_files : PtrStatFs->Bits64
f_ffree : PtrStatFs->Bits64
tv_sec : UV_Timespec_T->Int64
tv_nsec : UV_Timespec_T->Int64
prim__uv_fs_get_result : PtrFs->PrimIOInt32
uv_fs_req_cleanup : HasIOio=>PtrFs->io ()
Totality: total
Visibility: export
sync : HasIOio=> (PtrFs->FsCB->ioa) ->ioa
  Synchronously run a file system request.

Totality: total
Visibility: export
async : HasIOio=> (PtrFs->FsCB->ioa) -> (PtrFs->IO ()) ->ioa
  Asynchronously run a file system request.

Totality: total
Visibility: export
async' : HasIOio=> (PtrFs->FsCB->ioa) ->ioa
  Asynchronously run a file system request without running a
a custom callback.

Totality: total
Visibility: export
uv_fs_get_result : HasIOio=>PtrFs->ioInt32
  Returns the result code received after a file operation.

Totality: total
Visibility: export
uv_fs_get_ptr : HasIOio=>PtrFs->ioAnyPtr
  Returns the result of `uv_fs_readlink` and `uv_fs_realpath`

Totality: total
Visibility: export
uv_fs_get_path : HasIOio=>PtrFs->io (PtrChar)
  Path affecting the request

Totality: total
Visibility: export
uv_fs_get_statbuf : HasIOio=>PtrFs->io (PtrStat)
  Returns the result of `uv_fs_stat` and other stat requests.

Totality: total
Visibility: export
  Equivalent to unlink(2).

Totality: total
Visibility: export
uv_fs_mkdir : HasIOio=>PtrLoop->String->Int32->PtrFs->FsCB->ioInt32
  Equivalent to mkdir(2).

Totality: total
Visibility: export
uv_fs_mkdtemp : HasIOio=>PtrLoop->String->PtrFs->FsCB->ioInt32
  Equivalent to mkdtemp(3). The result can be found as a null
terminated string at req->path.

Totality: total
Visibility: export
uv_fs_mkstemp : HasIOio=>PtrLoop->String->PtrFs->FsCB->ioInt32
  Equivalent to mkstemp(3). The result can be found as a null
terminated string at req->path.

Totality: total
Visibility: export
uv_fs_rmdir : HasIOio=>PtrLoop->String->PtrFs->FsCB->ioInt32
  Equivalent to rmdir(2).

Totality: total
Visibility: export
uv_fs_opendir : HasIOio=>PtrLoop->String->PtrFs->FsCB->ioInt32
  Opens path as a directory stream. On success,
a uv_dir_t is allocated and returned via req->ptr.
This memory is not freed by uv_fs_req_cleanup(), although req->ptr
is set to NULL. The allocated memory must be freed by
calling uv_fs_closedir(). On failure, no memory is allocated.

The contents of the directory can be iterated over by passing the
resulting uv_dir_t to uv_fs_readdir().

Totality: total
Visibility: export
uv_fs_closedir : HasIOio=>PtrLoop->PtrDir->PtrFs->FsCB->ioInt32
  Closes the directory stream represented by dir and frees the
memory allocated by `uv_fs_opendir`.

Totality: total
Visibility: export
uv_fs_readdir : HasIOio=>PtrLoop->PtrDir->PtrFs->FsCB->ioInt32
  Iterates  over  the directory stream, dir, returned by a
successful `uv_fs_opendir` call. Prior to invoking `uv_fs_readdir`,
the caller must set dir->dirents and dir->nentries,
representing the array of uv_dirent_t ele‐
ments used to hold the read directory entries and its size.

On success, the result is an integer >= 0 representing the number
of entries read from the stream.
NOTE:
On success this function allocates memory that must be
freed using `uv_fs_req_cleanup`. `uv_fs_req_cleanup` must
be called before closing the directory with `uv_fs_closedir`.

Totality: total
Visibility: export
uv_fs_scandir : HasIOio=>PtrLoop->String->Int32->PtrFs->FsCB->ioInt32
  Equivalent to scandir(3), with a slightly different API.
Once the callback for the request is called, the user can use
`uv_fs_scandir_next` to get ent populated with the next
directory entry data. When there are no more
entries UV_EOF will be returned.

NOTE:
Unlike scandir(3), this function does not return the "." and ".." entries.

NOTE:
On Linux, getting the type of an entry is only supported
by some file systems (btrfs, ext2, ext3 and ext4 at the time of this writing),
check the getdents(2) man page.

Totality: total
Visibility: export
uv_fs_scandir_next : HasIOio=>PtrFs->PtrDirent->ioInt32
  See `uv_fs_scandir`.

Totality: total
Visibility: export
uv_dirents : HasIOio=>PtrDir->io (PtrDirent)
Totality: total
Visibility: export
uv_nentries : HasIOio=>PtrDir->ioBits32
Totality: total
Visibility: export
uv_fs_get_dirent_name : HasIOio=>PtrDirent->io (PtrChar)
Totality: total
Visibility: export
uv_fs_get_dirent_type : HasIOio=>PtrDirent->ioInt32
Totality: total
Visibility: export
uv_fs_close : HasIOio=>PtrLoop->Int32->PtrFs->FsCB->ioInt32
  Asynchronously closes a file and releases the file handle.

Once the file is closed, the given `IO` action is invoked.

Totality: total
Visibility: export
uv_fs_open : HasIOio=>PtrLoop->String->Bits32->Bits32->PtrFs->FsCB->ioInt32
  Asynchronously opens a file, invoking the given callback once
the file is ready.

Totality: total
Visibility: export
uv_fs_read : HasIOio=>PtrLoop->Int32->PtrBits8->Bits32->Int64->PtrFs->FsCB->ioInt32
  Reads data from a file into the given buffer and invokes
the callback function once the data is ready.

This is a faithful binding to `uv_fs_read`. What you typically want is
to decide on the return value stored in the `Ptr Fs` you get to figure
out what to do next. For that, there is `fsRead` as a more convenient
version.

Totality: total
Visibility: export
uv_fs_write : HasIOio=>PtrLoop->Int32->PtrBits8->Bits32->Int64->PtrFs->FsCB->ioInt32
  Writes data from the given buffer to a file and invokes
the callback function once the data is ready.

Totality: total
Visibility: export
uv_fs_stat : HasIOio=>PtrLoop->String->PtrFs->FsCB->ioInt32
Totality: total
Visibility: export
uv_fs_fstat : HasIOio=>PtrLoop->Int32->PtrFs->FsCB->ioInt32
Totality: total
Visibility: export
uv_fs_lstat : HasIOio=>PtrLoop->String->PtrFs->FsCB->ioInt32
Totality: total
Visibility: export
uv_fs_statfs : HasIOio=>PtrLoop->String->PtrFs->FsCB->ioInt32
  Equivalent to statfs(2). On success, a
`uv_statfs_t` is allocated and returned via req->ptr.
This memory is freed by `uv_fs_req_cleanup`.
NOTE:
Any fields in the resulting uv_statfs_t that are not
supported by the underlying operating system are set to zero.

Totality: total
Visibility: export
uv_fs_rename : HasIOio=>PtrLoop->String->String->PtrFs->FsCB->ioInt32
  Equivalent to rename(2).

Totality: total
Visibility: export
uv_fs_fsync : HasIOio=>PtrLoop->Int32->PtrFs->FsCB->ioInt32
  Equivalent to fsync(2).

NOTE:
For AIX, uv_fs_fsync returns UV_EBADF on file
descriptors referencing non regular files.

Totality: total
Visibility: export
uv_fs_fdatasync : HasIOio=>PtrLoop->Int32->PtrFs->FsCB->ioInt32
  Equivalent to fdatasync(2).

Totality: total
Visibility: export
uv_fs_ftruncate : HasIOio=>PtrLoop->Int32->Int64->PtrFs->FsCB->ioInt32
  Equivalent to ftruncate(2).

Totality: total
Visibility: export
uv_fs_copyfile : HasIOio=>PtrLoop->String->String->Int32->PtrFs->FsCB->ioInt32
  Copies a file from path to new_path.
Supported flags are described below.

• UV_FS_COPYFILE_EXCL: If present, `uv_fs_copyfile` will fail
with UV_EEXIST if the destination path already exists.
The default behavior is to overwrite the destination if it exists.

• UV_FS_COPYFILE_FICLONE: If present, `uv_fs_copyfile` will
attempt to create a copy-on-write reflink. If the underlying
platform does not support copy-on-write, or an error occurs
while attempting to use copy-on-write,
a fallback copy mechanism based on uv_fs_sendfile() is used.

• UV_FS_COPYFILE_FICLONE_FORCE: If present, `uv_fs_copyfile`
will attempt to create a copy-on-write reflink. If the
underlying platform does not support copy-on-write, or an error
occurs while attempting to use copy-on-write, then an error is returned.

WARNING:
If the destination path is created, but an error occurs while copying
the data, then the destination path is removed. There is a brief
window of time between closing and removing the file where
another process could access the file.

Totality: total
Visibility: export
uv_fs_sendfile : HasIOio=>PtrLoop->Int32->Int32->Int64->Bits32->PtrFs->FsCB->ioInt32
  Limited equivalent to sendfile(2).

Totality: total
Visibility: export
uv_fs_access : HasIOio=>PtrLoop->String->Int32->PtrFs->FsCB->ioInt32
  Equivalent to access(2) on Unix. Windows uses GetFileAttributesW().

Totality: total
Visibility: export
uv_fs_chmod : HasIOio=>PtrLoop->String->Int32->PtrFs->FsCB->ioInt32
  Equivalent to chmod(2) respectively.

Totality: total
Visibility: export
uv_fs_fchmod : HasIOio=>PtrLoop->Int32->Int32->PtrFs->FsCB->ioInt32
  Equivalent to fchmod(2) respectively.

Totality: total
Visibility: export
uv_fs_utime : HasIOio=>PtrLoop->String->Double->Double->PtrFs->FsCB->ioInt32
  Equivalent to utime(2).

Totality: total
Visibility: export
uv_fs_futime : HasIOio=>PtrLoop->Int32->Double->Double->PtrFs->FsCB->ioInt32
  Equivalent to futime(2).

Totality: total
Visibility: export
uv_fs_lutime : HasIOio=>PtrLoop->String->Double->Double->PtrFs->FsCB->ioInt32
  Equivalent to lutime(2).

Totality: total
Visibility: export
  Equivalent to link(2).

Totality: total
Visibility: export
  Equivalent to symlink(2).

NOTE:
On Windows the flags parameter can be specified to control
how the symlink will be created:

• UV_FS_SYMLINK_DIR: indicates that path points to a directory.

• UV_FS_SYMLINK_JUNCTION: request that the symlink is
created using junction points.

Totality: total
Visibility: export
  Equivalent to readlink(2).  The resulting string is stored in req->ptr.

Totality: total
Visibility: export
uv_fs_realpath : HasIOio=>PtrLoop->String->PtrFs->FsCB->ioInt32
  Equivalent to realpath(3) on Unix. Windows uses
GetFinalPathNameByHandle. The resulting string is stored in req->ptr.

WARNING:
This function has certain platform-specific caveats that
were discovered when used in Node.

• macOS and other BSDs: this function will fail with UV_ELOOP if
more than 32 symlinks are found while resolving the given path.
This limit is hardcoded and cannot be sidestepped.

• Windows: while this function works in the common case,
there are a number of corner cases where it doesn't:

• Paths in ramdisk volumes created by tools which sidestep the
Volume Manager (such as ImDisk) cannot be resolved.

• Inconsistent casing when using drive letters.

• Resolved path bypasses subst'd drives.

While this function can still be used, it's not recommended
if scenarios such as the above need to be supported.

Totality: total
Visibility: export
uv_fs_chown : HasIOio=>PtrLoop->String->Int32->Int32->PtrFs->FsCB->ioInt32
  Equivalent to chown(2).

Totality: total
Visibility: export
uv_fs_fchown : HasIOio=>PtrLoop->String->Int32->Int32->PtrFs->FsCB->ioInt32
  Equivalent to fchown(2).

Totality: total
Visibility: export
uv_fs_lchown : HasIOio=>PtrLoop->String->Int32->Int32->PtrFs->FsCB->ioInt32
  Equivalent to lchown(2).

Totality: total
Visibility: export