fs

uv.fs.close(fd)

See the manpages for close(2)

Arguments:
  • fd (int) – A file descriptor that is open.
Throws:

If unable to close the file descriptor/the file descriptor does not exist.

uv.fs.open(path, flags, callback)

See the manpages for open(2)

Arguments:
  • path (string) – The path to the file. May be relative to the current working directory.
  • flags (string) – Flags to open the file with.
  • callback (function(fd)) – The callback that will recieve the file descriptor of the newly opened file.
uv.fs.read(fd, size, offset, callback)

See the manpages for preadv(2)

Arguments:
  • fd (int) – The opened file-descriptor.
  • size (int) – The amount of bytes to read from the file.
  • offset (int) – The offset to read from.
  • callback (function(ArrayBuffer)) – The callback function which will take an ArrayBuffer as it’s first argument.

See the manpages for unlink(2)

Arguments:
  • fd (int) – The opened file-descriptor
  • callback (function(bool)) – A callback that will accept a boolean as it’s first argument, indicating the status of the request.
uv.fs.write(fd, array, offset, callback)

See the manpages for pwritev(2)

Arguments:
  • fd (int) – The opened file-descriptor.
  • array (Uint8Array) – The bytes to write out to the file.
  • offset (int) – The offset for writing to the file.
  • callback (function(bool)) – A callback that will accept a boolean as it’s first argument, indicating the status of the request.
uv.fs.mkdir(path, callback)

See the manpages for mkdir(2)

Arguments:
  • path (string) – The path to create.
  • callback (function(bool)) – The callback which will recieve the status of the request.
uv.fs.mkdtemp(path, callback)

See the manpages for mkdtemp(3)

uv.fs.rmdir(path, callback)

See the manpages for rmdir(2)

uv.fs.scandir(path, callback)

See the manpages for scandir(3)

After this function finishes execution, the callback will recieve a function which you can repeatedly call to get the next file.

uv.fs.stat(path, callback)

See the manpages for stat(2)

uv.fs.fstat(fd, callback)

See the manpages for fstat(2)

uv.fs.lstat(path, callback)

See the manpages for lstat(2)

uv.fs.rename(path, new_path, callback)

See the manpages for rename(2)

uv.fs.fsync(fd, callback)

See the manpages for fsync(2)

uv.fs.fdatasync(fd, callback)

See the manpages for fdatasync(2)

uv.fs.ftruncate(fd, offset, callback)

See the manpages for ftruncate(2)

uv.fs.sendfile(fd, out_fd, offset, length, callback)

See the manpages for sendfile(2)

uv.fs.access(path, flags, callback)

See the manpages for access(2)

uv.fs.chmod(path, flags, callback)

See the manpages for chmod(2)

uv.fs.fchmod(fd, flags, callback)

See the manpages for fchmod(2)

uv.fs.utime(path, atime, mtime, callback)

See the manpages for utime(2)

uv.fs.futime(fd, atime, mtime, callback)

See the manpages for futime(2)

See the manpages for link(2)

See the manpages for symlink(2)

See the manpages for readlink(2)

uv.fs.chown(path, uid, gid, callback)

See the manpages for chown(2)

uv.fs.fchown(fd, uid, gid, callback)

See the manpages for fchown(2)