object Fs extends Object with Fs

File System Singleton

Annotations
@native() @JSImport("fs", JSImport.Namespace)
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Fs
  2. Fs
  3. FSConstants
  4. Object
  5. Any
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. trait Dir extends Object
    Annotations
    @JSType() @native()
  2. class Dirent extends Object
    Annotations
    @JSType() @native()
  3. trait FileHandle extends Object
    Annotations
    @JSType() @native()
  4. trait FsPromises extends Object
    Annotations
    @JSType() @native()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val COPYFILE_EXCL: Int
    Definition Classes
    FSConstants
  5. val COPYFILE_FICLONE: Int
    Definition Classes
    FSConstants
  6. val COPYFILE_FICLONE_FORCE: Int
    Definition Classes
    FSConstants
  7. val F_OK: FileMode

    File is visible to the calling process.

    File is visible to the calling process. This is useful for determining if a file exists, but says nothing about rwx permissions. Default if no mode is specified.

    Definition Classes
    FSConstants
  8. val O_APPEND: Int

    Flag indicating that data will be appended to the end of the file.

    Flag indicating that data will be appended to the end of the file.

    Definition Classes
    FSConstants
  9. val O_CREAT: Int

    Flag indicating to create the file if it does not already exist.

    Flag indicating to create the file if it does not already exist.

    Definition Classes
    FSConstants
  10. val O_DIRECT: Int

    When set, an attempt will be made to minimize caching effects of file I/O.

    When set, an attempt will be made to minimize caching effects of file I/O.

    Definition Classes
    FSConstants
  11. val O_DIRECTORY: Int

    Flag indicating that the open should fail if the path is not a directory.

    Flag indicating that the open should fail if the path is not a directory.

    Definition Classes
    FSConstants
  12. val O_DSYNC: Int

    Flag indicating that the file is opened for synchronized I/O with write operations waiting for data integrity.

    Flag indicating that the file is opened for synchronized I/O with write operations waiting for data integrity.

    Definition Classes
    FSConstants
  13. val O_EXCL: Int

    Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists.

    Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists.

    Definition Classes
    FSConstants
  14. val O_NOATIME: Int

    Flag indicating reading accesses to the file system will no longer result in an update to the atime information associated with the file.

    Flag indicating reading accesses to the file system will no longer result in an update to the atime information associated with the file. This flag is available on Linux operating systems only.

    Definition Classes
    FSConstants
  15. val O_NOCTTY: Int

    Flag indicating that if path identifies a terminal device, opening the path shall not cause that terminal to become the controlling terminal for the process (if the process does not already have one).

    Flag indicating that if path identifies a terminal device, opening the path shall not cause that terminal to become the controlling terminal for the process (if the process does not already have one).

    Definition Classes
    FSConstants
  16. val O_NOFOLLOW: Int

    Flag indicating that the open should fail if the path is a symbolic link.

    Flag indicating that the open should fail if the path is a symbolic link.

    Definition Classes
    FSConstants
  17. val O_NONBLOCK: Int

    Flag indicating to open the file in nonblocking mode when possible.

    Flag indicating to open the file in nonblocking mode when possible.

    Definition Classes
    FSConstants
  18. val O_RDONLY: Int

    Flag indicating to open a file for read-only access.

    Flag indicating to open a file for read-only access.

    Definition Classes
    FSConstants
  19. val O_RDWR: Int

    Flag indicating to open a file for read-write access.

    Flag indicating to open a file for read-write access.

    Definition Classes
    FSConstants
  20. val O_SYMLINK: Int

    Flag indicating to open the symbolic link itself rather than the resource it is pointing to.

    Flag indicating to open the symbolic link itself rather than the resource it is pointing to.

    Definition Classes
    FSConstants
  21. val O_SYNC: Int

    Flag indicating that the file is opened for synchronous I/O.

    Flag indicating that the file is opened for synchronous I/O.

    Definition Classes
    FSConstants
  22. val O_TRUNC: Int

    Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero.

    Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero.

    Definition Classes
    FSConstants
  23. val O_WRONLY: Int

    Flag indicating to open a file for write-only access.

    Flag indicating to open a file for write-only access.

    Definition Classes
    FSConstants
  24. val R_OK: FileMode

    File can be read by the calling process.

    File can be read by the calling process.

    Definition Classes
    FSConstants
  25. val S_IFBLK: FileType

    File type constant for a block-oriented device file.

    File type constant for a block-oriented device file.

    Definition Classes
    FSConstants
  26. val S_IFCHR: FileType

    File type constant for a character-oriented device file.

    File type constant for a character-oriented device file.

    Definition Classes
    FSConstants
  27. val S_IFDIR: FileType

    File type constant for a directory.

    File type constant for a directory.

    Definition Classes
    FSConstants
  28. val S_IFIFO: FileType

    File type constant for a FIFO/pipe.

    File type constant for a FIFO/pipe.

    Definition Classes
    FSConstants
  29. val S_IFLNK: FileType

    File type constant for a symbolic link.

    File type constant for a symbolic link.

    Definition Classes
    FSConstants
  30. val S_IFMT: FileType

    Bit mask used to extract the file type code.

    Bit mask used to extract the file type code.

    Definition Classes
    FSConstants
  31. val S_IFREG: FileType

    File type constant for a regular file.

    File type constant for a regular file.

    Definition Classes
    FSConstants
  32. val S_IFSOCK: FileType

    File type constant for a socket.

    File type constant for a socket.

    Definition Classes
    FSConstants
  33. val S_IRGRP: FileMode
    Definition Classes
    FSConstants
  34. val S_IROTH: FileMode
    Definition Classes
    FSConstants
  35. val S_IRUSR: FileMode
    Definition Classes
    FSConstants
  36. val S_IRWXG: FileMode
    Definition Classes
    FSConstants
  37. val S_IRWXO: FileMode
    Definition Classes
    FSConstants
  38. val S_IRWXU: FileMode
    Definition Classes
    FSConstants
  39. val S_IWGRP: FileMode
    Definition Classes
    FSConstants
  40. val S_IWOTH: FileMode
    Definition Classes
    FSConstants
  41. val S_IWUSR: FileMode
    Definition Classes
    FSConstants
  42. val S_IXGRP: FileMode
    Definition Classes
    FSConstants
  43. val S_IXOTH: FileMode
    Definition Classes
    FSConstants
  44. val S_IXUSR: FileMode
    Definition Classes
    FSConstants
  45. val W_OK: FileMode

    File can be written by the calling process.

    File can be written by the calling process.

    Definition Classes
    FSConstants
  46. val X_OK: FileMode

    File can be executed by the calling process.

    File can be executed by the calling process. This has no effect on Windows (will behave like F_OK).

    Definition Classes
    FSConstants
  47. def access(path: Path, callback: FsCallback0): Unit

    Tests a user's permissions for the file specified by path.

    Tests a user's permissions for the file specified by path. mode is an optional integer that specifies the accessibility checks to be performed. The following constants define the possible values of mode. It is possible to create a mask consisting of the bitwise OR of two or more values.

    • fs.F_OK - File is visible to the calling process. This is useful for determining if a file exists, but says nothing about rwx permissions. Default if no mode is specified.
    • FSConstants.R_OK - File can be read by the calling process.
    • FSConstants.W_OK - File can be written by the calling process.
    • FSConstants.X_OK - File can be executed by the calling process. This has no effect on Windows (will behave like F_OK).
    path

    the path (Buffer | String)

    callback

    is a callback function that is invoked with a possible error argument. If any of the accessibility checks fail, the error argument will be populated.

    Definition Classes
    Fs
    Example:
    1. fs.access(path[, mode], callback)

  48. def access(path: Path, mode: FileMode, callback: FsCallback0): Unit

    Tests a user's permissions for the file specified by path.

    Tests a user's permissions for the file specified by path. mode is an optional integer that specifies the accessibility checks to be performed. The following constants define the possible values of mode. It is possible to create a mask consisting of the bitwise OR of two or more values.

    • fs.F_OK - File is visible to the calling process. This is useful for determining if a file exists, but says nothing about rwx permissions. Default if no mode is specified.
    • FSConstants.R_OK - File can be read by the calling process.
    • FSConstants.W_OK - File can be written by the calling process.
    • FSConstants.X_OK - File can be executed by the calling process. This has no effect on Windows (will behave like F_OK).
    path

    the path (Buffer | String)

    mode

    the optional mode

    callback

    is a callback function that is invoked with a possible error argument. If any of the accessibility checks fail, the error argument will be populated.

    Definition Classes
    Fs
    Example:
    1. fs.access(path[, mode], callback)

  49. def accessSync(path: Path): Unit
    Definition Classes
    Fs
  50. def accessSync(path: Path, mode: FileMode): Unit

    Synchronous version of fs.access().

    Synchronous version of fs.access(). This throws if any accessibility checks fail, and does nothing otherwise.

    path

    the path (Buffer | String)

    mode

    the optional mode

    Definition Classes
    Fs
    Example:
    1. fs.accessSync(path[, mode])

  51. def appendFile(path: FileDescriptor, data: String, callback: FsCallback0): Unit
    Definition Classes
    Fs
  52. def appendFile(path: FileDescriptor, data: Buffer, callback: FsCallback0): Unit
    Definition Classes
    Fs
  53. def appendFile(path: Path, data: String, callback: FsCallback0): Unit
    Definition Classes
    Fs
  54. def appendFile(path: Path, data: Buffer, callback: FsCallback0): Unit

    Asynchronously append data to a file, creating the file if it does not yet exist.

    Asynchronously append data to a file, creating the file if it does not yet exist. data can be a string or a buffer.

    path

    the filename or file descriptor (Buffer | String | Number)

    data

    the data to append (Buffer | String)

    callback

    the callback function

    Definition Classes
    Fs
    Example:
    1. fs.appendFile(file, data[, options], callback)

  55. def appendFile(file: FileDescriptor, data: String, options: FileAppendOptions, callback: FsCallback0): Unit
    Definition Classes
    Fs
  56. def appendFile(file: FileDescriptor, data: Buffer, options: FileAppendOptions, callback: FsCallback0): Unit
    Definition Classes
    Fs
  57. def appendFile(file: Path, data: String, options: FileAppendOptions, callback: FsCallback0): Unit
    Definition Classes
    Fs
  58. def appendFile(file: Path, data: Buffer, options: FileAppendOptions, callback: FsCallback0): Unit

    Asynchronously append data to a file, creating the file if it does not yet exist.

    Asynchronously append data to a file, creating the file if it does not yet exist. data can be a string or a buffer.

    file

    the filename or file descriptor (Buffer | String | Number)

    data

    the data to append (Buffer | String)

    options

    the optional append settings

    callback

    the callback function

    Definition Classes
    Fs
    Example:
    1. fs.appendFile(file, data[, options], callback)

  59. def appendFileSync(path: FileDescriptor, data: String): Unit
    Definition Classes
    Fs
  60. def appendFileSync(path: FileDescriptor, data: Buffer): Unit
    Definition Classes
    Fs
  61. def appendFileSync(path: FileDescriptor, data: String, options: FileAppendOptions): Unit
    Definition Classes
    Fs
  62. def appendFileSync(path: FileDescriptor, data: Buffer, options: FileAppendOptions): Unit
    Definition Classes
    Fs
  63. def appendFileSync(path: Path, data: String): Unit
    Definition Classes
    Fs
  64. def appendFileSync(path: Path, data: Buffer): Unit
    Definition Classes
    Fs
  65. def appendFileSync(path: Path, data: String, options: FileAppendOptions): Unit
    Definition Classes
    Fs
  66. def appendFileSync(path: Path, data: Buffer, options: FileAppendOptions): Unit

    The synchronous version of fs.appendFile().

    The synchronous version of fs.appendFile().

    path

    the filename or file descriptor (Buffer | String | Number)

    data

    the data to append (Buffer | String)

    options

    the optional append settings

    returns

    undefined.

    Definition Classes
    Fs
  67. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  68. def chmod(path: Path, mode: FileMode, callback: FsCallback0): Unit

    Asynchronous chmod(2).

    Asynchronous chmod(2). No arguments other than a possible exception are given to the completion callback.

    path

    the file or directory path (Buffer | String)

    mode

    the file or directory mode

    callback

    the completion callback.

    Definition Classes
    Fs
  69. def chmodSync(path: Path, mode: FileMode): Unit

    Synchronous chmod(2).

    Synchronous chmod(2).

    path

    the file or directory path (Buffer | String)

    mode

    the file or directory mode

    returns

    undefined.

    Definition Classes
    Fs
  70. def chown(path: Path, uid: UID, gid: GID, callback: FsCallback0): Unit

    Asynchronous chown(2).

    Asynchronous chown(2). No arguments other than a possible exception are given to the completion callback.

    path

    the file or directory path (Buffer | String)

    uid

    the user ID

    gid

    the group ID

    callback

    the completion callback.

    Definition Classes
    Fs
  71. def chownSync(path: Path, uid: UID, gid: GID): Unit

    Synchronous chown(2).

    Synchronous chown(2).

    path

    the file or directory path (Buffer | String)

    uid

    the user ID

    gid

    the group ID

    returns

    undefined.

    Definition Classes
    Fs
  72. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  73. def close(fd: FileDescriptor, callback: FsCallback0): Unit

    Asynchronous close(2).

    Asynchronous close(2). No arguments other than a possible exception are given to the completion callback.

    Definition Classes
    Fs
    Example:
    1. fs.close(fd, callback)

  74. def closeSync(fd: FileDescriptor): Unit

    Synchronous close(2).

    Synchronous close(2).

    returns

    undefined.

    Definition Classes
    Fs
    Example:
    1. fs.closeSync(fd)

  75. def constants: FSConstants

    Returns an object containing commonly used constants for file system operations

    Returns an object containing commonly used constants for file system operations

    returns

    an object containing commonly used constants for file system operations

    Definition Classes
    Fs
  76. def copyFile(src: Path, dest: Path, callback: FsCallback0): Unit

    Asynchronously copies src to dest.

    Asynchronously copies src to dest. By default, dest is overwritten if it already exists. No arguments other than a possible exception are given to the callback function. Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination.

    flags is an optional integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists.

    src

    the source filename to copy

    dest

    the destination filename of the copy operation

    callback

    the callback function

    Definition Classes
    Fs
    Example:
    1. fs.copyFile(src, dest[, flags], callback)
  77. def copyFile(src: Path, dest: Path, flags: Flags, callback: FsCallback0): Unit

    Asynchronously copies src to dest.

    Asynchronously copies src to dest. By default, dest is overwritten if it already exists. No arguments other than a possible exception are given to the callback function. Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination.

    flags is an optional integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists.

    src

    the source filename to copy

    dest

    the destination filename of the copy operation

    flags

    the modifiers for copy operation. Default: 0

    callback

    the callback function

    Definition Classes
    Fs
    Example:
    1. fs.copyFile(src, dest[, flags], callback)
  78. def copyFileSync(src: Path, dest: Path, flags: Flags): Unit

    Synchronously copies src to dest.

    Synchronously copies src to dest. By default, dest is overwritten if it already exists.

    Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination.

    flags is an optional integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists.

    src

    the source filename to copy

    dest

    the destination filename of the copy operation

    flags

    the modifiers for copy operation. Default: 0

    Definition Classes
    Fs
    Example:
    1. fs.copyFileSync(src, dest[, flags])
  79. def createReadStream(path: Path): ReadStream
    Definition Classes
    Fs
  80. def createReadStream(path: Path, options: FileInputOptions): ReadStream

    Returns a new ReadStream object.

    Returns a new ReadStream object. (See Readable Stream). Be aware that, unlike the default value set for highWaterMark on a readable stream (16 kb), the stream returned by this method has a default value of 64 kb for the same parameter.

    path

    the path (Buffer | String)

    options

    the optional stream options

    Definition Classes
    Fs
    Example:
    1. fs.createReadStream(path[, options])

  81. def createWriteStream(path: Path): WriteStream
    Definition Classes
    Fs
  82. def createWriteStream(path: Path, options: FileOutputOptions): WriteStream

    Returns a new WriteStream object.

    Returns a new WriteStream object.

    path

    the path (Buffer | String)

    options

    the optional stream options

    Definition Classes
    Fs
    Example:
    1. fs.createWriteStream(path[, options])

  83. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  84. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  85. def existsSync(path: Path): Boolean

    fs.exists() should not be used to check if a file exists before calling fs.open().

    fs.exists() should not be used to check if a file exists before calling fs.open(). Doing so introduces a race condition since other processes may change the file's state between the two calls. Instead, user code should call fs.open() directly and handle the error raised if the file is non-existent.

    Definition Classes
    Fs
    Example:
    1. fs.existsSync(path)

  86. def fchmod(fd: FileDescriptor, mode: FileMode, callback: FsCallback0): Unit

    Asynchronous fchmod(2).

    Asynchronous fchmod(2). No arguments other than a possible exception are given to the completion callback.

    Definition Classes
    Fs
    Example:
    1. fs.fchmod(fd, mode, callback)

  87. def fchmodSync(fd: FileDescriptor, mode: FileMode): Unit

    Synchronous fchmod(2).

    Synchronous fchmod(2).

    returns

    undefined.

    Definition Classes
    Fs
    Example:
    1. fs.fchmodSync(fd, mode)

  88. def fchown(fd: FileDescriptor, uid: UID, gid: GID, callback: FsCallback0): Unit

    Asynchronous fchown(2).

    Asynchronous fchown(2). No arguments other than a possible exception are given to the completion callback.

    fd

    the file descriptor

    uid

    the user ID

    gid

    the group ID

    callback

    the completion callback.

    Definition Classes
    Fs
  89. def fchownSync(fd: FileDescriptor, uid: UID, gid: GID): Unit

    Synchronous fchown(2).

    Synchronous fchown(2).

    fd

    the file descriptor

    uid

    the user ID

    gid

    the group ID

    Definition Classes
    Fs
  90. def fdatasync(fd: FileDescriptor, callback: FsCallback0): Unit

    Asynchronous fdatasync(2).

    Asynchronous fdatasync(2). No arguments other than a possible exception are given to the completion callback.

    Definition Classes
    Fs
    Example:
    1. fs.fdatasync(fd, callback)

  91. def fdatasyncSync(fd: FileDescriptor): Unit

    Synchronous fdatasync(2).

    Synchronous fdatasync(2).

    returns

    undefined.

    Definition Classes
    Fs
    Example:
    1. fs.fdatasyncSync(fd)

  92. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  93. def fstat(fd: FileDescriptor, options: StatOptions, callback: FsCallback1[StatsVariant]): Unit
    Definition Classes
    Fs
  94. def fstat(fd: FileDescriptor, callback: FsCallback1[Stats]): Unit

    Asynchronous fstat(2).

    Asynchronous fstat(2). The callback gets two arguments (err, stats) where stats is an fs.Stats object. fstat() is identical to stat(), except that the file to be stat-ed is specified by the file descriptor fd.

    fd

    the file descriptor

    callback

    the completion callback.

    Definition Classes
    Fs
  95. def fstatSync(fd: FileDescriptor): StatsVariant
    Definition Classes
    Fs
  96. def fstatSync(fd: FileDescriptor, options: StatOptions): StatsVariant

    Synchronous fstat(2).

    Synchronous fstat(2).

    fd

    the file descriptor

    returns

    an instance of fs.Stats.

    Definition Classes
    Fs
  97. def fsync(fd: FileDescriptor, callback: FsCallback0): Unit

    Asynchronous fsync(2).

    Asynchronous fsync(2). No arguments other than a possible exception are given to the completion callback.

    fd

    the file descriptor

    callback

    the completion callback.

    Definition Classes
    Fs
  98. def fsyncSync(fd: FileDescriptor): Unit

    Synchronous fsync(2).

    Synchronous fsync(2).

    fd

    the file descriptor

    returns

    undefined.

    Definition Classes
    Fs
  99. def ftruncate(fd: FileDescriptor, length: Int, callback: FsCallback0): Unit

    Asynchronous ftruncate(2).

    Asynchronous ftruncate(2). No arguments other than a possible exception are given to the completion callback. If the file referred to by the file descriptor was larger than length bytes, only the first length bytes will be retained in the file.

    fd

    the file descriptor

    length

    the desired length

    callback

    the completion callback.

    Definition Classes
    Fs
  100. def ftruncate(fd: FileDescriptor, callback: FsCallback0): Unit

    Asynchronous ftruncate(2).

    Asynchronous ftruncate(2). No arguments other than a possible exception are given to the completion callback. If the file referred to by the file descriptor was larger than length bytes, only the first length bytes will be retained in the file.

    fd

    the file descriptor

    callback

    the completion callback.

    Definition Classes
    Fs
  101. def ftruncateSync(fd: FileDescriptor): Unit
    Definition Classes
    Fs
  102. def ftruncateSync(fd: FileDescriptor, length: Int): Unit

    Synchronous ftruncate(2).

    Synchronous ftruncate(2).

    fd

    the file descriptor

    length

    the desired length

    returns

    undefined.

    Definition Classes
    Fs
  103. def futimes(fd: FileDescriptor, atime: Time, mtime: Time, callback: Function): Unit

    Change the file timestamps of a file referenced by the supplied file descriptor.

    Change the file timestamps of a file referenced by the supplied file descriptor.

    Definition Classes
    Fs
    Example:
    1. fs.futimes(fd, atime, mtime, callback)

  104. def futimesSync(fd: FileDescriptor, atime: Time, mtime: Time): Unit

    Synchronous version of fs.futimes().

    Synchronous version of fs.futimes().

    returns

    undefined.

    Definition Classes
    Fs
    Example:
    1. fs.futimesSync(fd, atime, mtime)

  105. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  106. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  107. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  108. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  109. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  110. def lchmod(path: Path, mode: FileMode, callback: FsCallback0): Unit

    Asynchronous lchmod(2).

    Asynchronous lchmod(2). No arguments other than a possible exception are given to the completion callback.

    Definition Classes
    Fs
    Example:
    1. fs.lchmod(path, mode, callback)

  111. def lchmodSync(path: Path, mode: FileMode): Unit

    Synchronous lchmod(2).

    Synchronous lchmod(2).

    path

    the path (Buffer | String)

    mode

    the mode (Integer)

    returns

    undefined.

    Definition Classes
    Fs
    Example:
    1. fs.lchmodSync(path, mode)

  112. def lchown(path: Path, uid: UID, gid: GID, callback: FsCallback0): Unit

    Asynchronous lchown(2).

    Asynchronous lchown(2). No arguments other than a possible exception are given to the completion callback.

    path

    the path (Buffer | String)

    uid

    the user ID

    gid

    the group ID

    callback

    the completion callback.

    Definition Classes
    Fs
    Example:
    1. fs.lchown(path, uid, gid, callback)

  113. def lchownSync(path: Path, uid: UID, gid: GID): Unit

    Synchronous chown(2).

    Synchronous chown(2).

    path

    the path (Buffer | String)

    uid

    the user ID

    gid

    the group ID

    returns

    undefined.

    Definition Classes
    Fs
  114. def link(existingPath: Path, newPath: Path, callback: FsCallback0): Unit

    Asynchronous link(2).

    Asynchronous link(2). No arguments other than a possible exception are given to the completion callback.

    existingPath

    the existing path

    newPath

    the new path

    callback

    the completion callback.

    Definition Classes
    Fs
    Example:
    1. fs.link(srcpath, dstpath, callback)

  115. def linkSync(existingPath: Path, newPath: Path): Unit

    Synchronous link(2).

    Synchronous link(2).

    existingPath

    the existing path

    newPath

    the new path

    returns

    undefined.

    Definition Classes
    Fs
  116. def lstat(path: Path, callback: FsCallback1[Stats]): Unit

    Asynchronous lstat(2).

    Asynchronous lstat(2). lstat() is identical to stat(), except that if path is a symbolic link, then the link itself is stat-ed, not the file that it refers to.

    path

    the path (Buffer | String)

    callback

    The callback gets two arguments (err, stats) where stats is a fs.Stats object.

    Definition Classes
    Fs
  117. def lstat(path: Path, options: StatOptions, callback: FsCallback1[StatsVariant]): Unit
    Definition Classes
    Fs
  118. def lstatSync(path: Path, options: StatOptions): StatsVariant
    Definition Classes
    Fs
  119. def lstatSync(path: Path): Stats

    Synchronous lstat(2).

    Synchronous lstat(2).

    path

    the path (Buffer | String)

    returns

    an instance of fs.Stats.

    Definition Classes
    Fs
  120. def mkdir(path: Path, callback: FsCallback0): Unit

    Asynchronous mkdir(2).

    Asynchronous mkdir(2). No arguments other than a possible exception are given to the completion callback. mode defaults to 0o777.

    Definition Classes
    Fs
    Example:
    1. fs.mkdir(path[, mode], callback)

  121. def mkdir(path: Path, mode: MkdirOptions, callback: FsRecursiveCallback0): Unit
    Definition Classes
    Fs
  122. def mkdir(path: Path, mode: MkdirOptions, callback: FsCallback0): Unit

    Asynchronous mkdir(2).

    Asynchronous mkdir(2). No arguments other than a possible exception are given to the completion callback. mode defaults to 0o777.

    After v13.11.0, in recursive mode, the callback now receives the first created path as an 2nd argument.

    Definition Classes
    Fs
    Example:
    1. fs.mkdir(path[, mode], callback)

  123. def mkdir(path: Path, mode: FileMode, callback: FsCallback0): Unit

    Asynchronous mkdir(2).

    Asynchronous mkdir(2). No arguments other than a possible exception are given to the completion callback. mode defaults to 0o777.

    Definition Classes
    Fs
    Example:
    1. fs.mkdir(path[, mode], callback)

  124. def mkdirSync(path: Path, mode: MkdirOptions): UndefOr[Path]

    returns

    After Node.js v13.11.0, in recursive mode, the first created path is returned now. Otherwise undefined

    Definition Classes
    Fs
  125. def mkdirSync(path: Path): Unit
    Definition Classes
    Fs
  126. def mkdirSync(path: Path, mode: FileMode): Unit

    Synchronous mkdir(2).

    Synchronous mkdir(2).

    path

    the path

    mode

    the mode

    Definition Classes
    Fs
  127. def mkdtemp(prefix: String, callback: FsCallback1[String]): Unit

    Creates a unique temporary directory.

    Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory. The created folder path is passed as a string to the callback's second parameter. The optional options argument can be a string specifying an encoding, or an object with an encoding property specifying the character encoding to use.

    prefix

    the prefix

    callback

    the callback

    Definition Classes
    Fs
    Example:
    1. fs.mkdtemp(prefix[, options], callback)

  128. def mkdtemp(prefix: String, options: FileEncodingOptions, callback: FsCallback1[String]): Unit
    Definition Classes
    Fs
  129. def mkdtemp(prefix: String, options: String, callback: FsCallback1[String]): Unit

    Creates a unique temporary directory.

    Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory. The created folder path is passed as a string to the callback's second parameter. The optional options argument can be a string specifying an encoding, or an object with an encoding property specifying the character encoding to use.

    prefix

    the prefix

    options

    the optional encoding setting

    callback

    the callback

    Definition Classes
    Fs
    Example:
    1. fs.mkdtemp(prefix[, options], callback)

  130. def mkdtempSync(prefix: String): String
    Definition Classes
    Fs
  131. def mkdtempSync(prefix: String, options: FileEncodingOptions): String
    Definition Classes
    Fs
  132. def mkdtempSync(prefix: String, options: String): String

    The synchronous version of fs.mkdtemp().

    The synchronous version of fs.mkdtemp(). Returns the created folder path. The optional options argument can be a string specifying an encoding, or an object with an encoding property specifying the character encoding to use.

    prefix

    the prefix

    options

    the optional encoding setting

    Definition Classes
    Fs
  133. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  134. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  135. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  136. def open(path: Path, callback: FsCallback1[FileDescriptor]): Unit
    Definition Classes
    Fs
  137. def open(path: Path, flags: Flags, callback: FsCallback1[FileDescriptor]): Unit

    Asynchronous file open.

    Asynchronous file open. See open(2).

    path

    the path (Buffer | String)

    flags

    flags can be:

    • 'r' - Open file for reading. An exception occurs if the file does not exist.
    • 'r+' - Open file for reading and writing. An exception occurs if the file does not exist.
    • 'rs+' - Open file for reading and writing in synchronous mode. Instructs the operating system to bypass the local file system cache. This is primarily useful for opening files on NFS mounts as it allows you to skip the potentially stale local cache. It has a very real impact on I/O performance so don't use this flag unless you need it. Note that this doesn't turn fs.open() into a synchronous blocking call. If that's what you want then you should be using fs.openSync()
    • 'w' - Open file for writing. The file is created (if it does not exist) or truncated (if it exists).
    • 'wx' - Like 'w' but fails if path exists.
    • 'w+' - Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).
    • 'wx+' - Like 'w+' but fails if path exists.
    • 'a' - Open file for appending. The file is created if it does not exist.
    • 'ax' - Like 'a' but fails if path exists.
    • 'a+' - Open file for reading and appending. The file is created if it does not exist.
    • 'ax+' - Like 'a+' but fails if path exists.
    callback

    the callback gets two arguments (err, fd)

    Definition Classes
    Fs
    Example:
    1. fs.open(path, flags[, mode], callback)

  138. def open(path: Path, flags: Flags, mode: FileMode, callback: FsCallback1[FileDescriptor]): Unit

    Asynchronous file open.

    Asynchronous file open. See open(2).

    path

    the path (Buffer | String)

    flags

    flags can be:

    • 'r' - Open file for reading. An exception occurs if the file does not exist.
    • 'r+' - Open file for reading and writing. An exception occurs if the file does not exist.
    • 'rs+' - Open file for reading and writing in synchronous mode. Instructs the operating system to bypass the local file system cache. This is primarily useful for opening files on NFS mounts as it allows you to skip the potentially stale local cache. It has a very real impact on I/O performance so don't use this flag unless you need it. Note that this doesn't turn fs.open() into a synchronous blocking call. If that's what you want then you should be using fs.openSync()
    • 'w' - Open file for writing. The file is created (if it does not exist) or truncated (if it exists).
    • 'wx' - Like 'w' but fails if path exists.
    • 'w+' - Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).
    • 'wx+' - Like 'w+' but fails if path exists.
    • 'a' - Open file for appending. The file is created if it does not exist.
    • 'ax' - Like 'a' but fails if path exists.
    • 'a+' - Open file for reading and appending. The file is created if it does not exist.
    • 'ax+' - Like 'a+' but fails if path exists.
    mode

    sets the file mode (permission and sticky bits), but only if the file was created. It defaults to 0666, readable and writable.

    callback

    the callback gets two arguments (err, fd)

    Definition Classes
    Fs
    Example:
    1. fs.open(path, flags[, mode], callback)

  139. def openSync(path: Path): FileDescriptor
    Definition Classes
    Fs
  140. def openSync(path: Path, flags: Flags): FileDescriptor
    Definition Classes
    Fs
  141. def openSync(path: Path, flags: Flags, mode: FileMode): FileDescriptor

    Synchronous version of fs.open().

    Synchronous version of fs.open().

    path

    the path (Buffer | String)

    flags

    the flags

    mode

    the file mode

    returns

    an integer representing the file descriptor.

    Definition Classes
    Fs
    Example:
    1. fs.openSync(path, flags[, mode])

  142. def opendir(path: Path, callback: FsCallback1[Dir]): Unit
    Definition Classes
    Fs
  143. def opendir(path: Path, options: OpendirOptions, callback: FsCallback1[Dir]): Unit
    Definition Classes
    Fs
  144. def opendirSync(path: Path): Dir
    Definition Classes
    Fs
  145. def opendirSync(path: Path, options: OpendirOptions): Dir
    Definition Classes
    Fs
  146. val promises: FsPromises
  147. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  148. def read(fd: FileDescriptor, buffer: BufferLike, offset: |[Int, Null], length: |[Int, Null], position: |[Int, Null], callback: FsCallback2[Int, Buffer]): Unit
    Definition Classes
    Fs
  149. def read(fd: FileDescriptor, buffer: Buffer, offset: |[Int, Null], length: |[Int, Null], position: |[Int, Null], callback: FsCallback2[Int, Buffer]): Unit

    Read data from the file specified by fd.

    Read data from the file specified by fd.

    fd

    is the file descriptor

    buffer

    is the buffer that the data will be written to.

    offset

    is the offset in the buffer to start writing at.

    length

    is an integer specifying the number of bytes to read.

    position

    is an integer specifying where to begin reading from in the file. If position is null, data will be read from the current file position.

    callback

    the callback is given the three arguments, (err, bytesRead, buffer).

    Definition Classes
    Fs
  150. def readFile(file: FileDescriptor, callback: FsCallback1[Buffer]): Unit
    Definition Classes
    Fs
  151. def readFile(file: Path, callback: FsCallback1[Buffer]): Unit

    Asynchronously reads the entire contents of a file.

    Asynchronously reads the entire contents of a file.

    file

    filename or file descriptor

    callback

    The callback is passed two arguments (err, data), where data is the contents of the file. If no encoding is specified, then the raw buffer is returned.

    Definition Classes
    Fs
    Example:
    1. fs.readFile(file[, options], callback)

  152. def readFile(file: FileDescriptor, encoding: String, callback: FsCallback1[String]): Unit
    Definition Classes
    Fs
  153. def readFile(file: Path, encoding: String, callback: FsCallback1[String]): Unit

    Asynchronously reads the entire contents of a file.

    Asynchronously reads the entire contents of a file.

    file

    filename or file descriptor

    encoding

    the encoding (default = null)

    callback

    The callback is passed two arguments (err, data), where data is the contents of the file. If no encoding is specified, then the raw buffer is returned.

    Definition Classes
    Fs
    Example:
    1. fs.readFile(file[, options], callback)

  154. def readFile(file: FileDescriptor, options: ReadFileOptions, callback: FsCallback1[Output]): Unit
    Definition Classes
    Fs
  155. def readFile(file: Path, options: ReadFileOptions, callback: FsCallback1[Output]): Unit

    Asynchronously reads the entire contents of a file.

    Asynchronously reads the entire contents of a file.

    file

    filename or file descriptor

    options

    the optional settings

    callback

    The callback is passed two arguments (err, data), where data is the contents of the file. If no encoding is specified, then the raw buffer is returned.

    Definition Classes
    Fs
    Example:
    1. fs.readFile(file[, options], callback)

  156. def readFileSync(file: FileDescriptor): Buffer
    Definition Classes
    Fs
  157. def readFileSync(file: Path): Buffer

    Synchronous version of fs.readFile.

    Synchronous version of fs.readFile.

    file

    filename or file descriptor <String> | <Buffer> | <Integer>

    returns

    the contents of the file. If the encoding option is specified then this function returns a string. Otherwise it returns a buffer.

    Definition Classes
    Fs
    Example:
    1. fs.readFileSync(file[, options])

  158. def readFileSync(file: FileDescriptor, options: ReadFileOptions): Output
    Definition Classes
    Fs
  159. def readFileSync(file: Path, options: ReadFileOptions): Output

    Synchronous version of fs.readFile.

    Synchronous version of fs.readFile. Returns the contents of the file.

    file

    filename or file descriptor <String> | <Buffer> | <Integer>

    options

    the optional encoding <Object> | <String>

    returns

    the contents of the file. If the encoding option is specified then this function returns a string. Otherwise it returns a buffer.

    Definition Classes
    Fs
    Example:
    1. fs.readFileSync(file[, options])

  160. def readFileSync(file: FileDescriptor, encoding: String): String
    Definition Classes
    Fs
  161. def readFileSync(file: Path, encoding: String): String

    Synchronous version of fs.readFile.

    Synchronous version of fs.readFile. Returns the contents of the file.

    file

    filename or file descriptor <String> | <Buffer> | <Integer>

    encoding

    the optional encoding <Object> | <String>

    returns

    the contents of the file. If the encoding option is specified then this function returns a string. Otherwise it returns a buffer.

    Definition Classes
    Fs
    Example:
    1. fs.readFileSync(file[, options])

  162. def readSync(fd: FileDescriptor, buffer: BufferLike, offset: Int, length: Int, position: Int): Int
    Definition Classes
    Fs
  163. def readSync(fd: FileDescriptor, buffer: Buffer, offset: Int, length: Int, position: Int): Int

    Synchronous version of fs.read().

    Synchronous version of fs.read().

    fd

    is the file descriptor

    buffer

    is the buffer that the data will be written to.

    offset

    is the offset in the buffer to start writing at.

    length

    is an integer specifying the number of bytes to read.

    position

    is an integer specifying where to begin reading from in the file. If position is null, data will be read from the current file position.

    returns

    the number of bytesRead.

    Definition Classes
    Fs
  164. def readdir(path: Path, callback: FsCallback1[Array[String]]): Unit
    Definition Classes
    Fs
  165. def readdir(path: Path, options: ReaddirOptions, callback: FsCallback1[ReaddirArrays2]): Unit
    Definition Classes
    Fs
  166. def readdir(path: Path, options: FileEncodingOptions, callback: FsCallback1[ReaddirArrays]): Unit
    Definition Classes
    Fs
  167. def readdir(path: Path, options: String, callback: FsCallback1[Array[String]]): Unit

    Asynchronous readdir(3).

    Asynchronous readdir(3). Reads the contents of a directory.

    path

    the path (Buffer | String)

    options

    the optional options argument can be a string specifying an encoding, or an object with an encoding property specifying the character encoding to use for the filenames passed to the callback. If the encoding is set to 'buffer', the filenames returned will be passed as Buffer objects.

    callback

    the callback gets two arguments (err, files) where files is an array of the names of the files in the directory excluding '.' and '..'.

    Definition Classes
    Fs
    Example:
    1. fs.readdir(path[, options], callback)

  168. def readdirSync(path: Path): Array[String]
    Definition Classes
    Fs
  169. def readdirSync(path: Path, options: ReaddirOptions): Array[String]
    Definition Classes
    Fs
  170. def readdirSync(path: Path, options: String): Array[String]

    Synchronous readdir(3).

    Synchronous readdir(3).

    path

    the path (Buffer | String)

    options

    the optional options argument can be a string specifying an encoding, or an object with an encoding property specifying the character encoding to use for the filenames passed to the callback. If the encoding is set to 'buffer', the filenames returned will be passed as Buffer objects.

    returns

    an array of filenames excluding '.' and '..'.

    Definition Classes
    Fs
  171. def readlink(path: Path, callback: FsCallback1[String]): Unit
    Definition Classes
    Fs
  172. def readlink(path: Path, options: FileEncodingOptions, callback: FsCallback1[Output]): Unit
    Definition Classes
    Fs
  173. def readlink(path: Path, options: String, callback: FsCallback1[Output]): Unit

    Asynchronous readlink(2).

    Asynchronous readlink(2). If the encoding is set to 'buffer', the link path returned will be passed as a Buffer object.

    path

    the path (Buffer | String)

    options

    the optional options argument can be a string specifying an encoding, or an object with an encoding property specifying the character encoding to use for the link path passed to the callback.

    callback

    the callback gets two arguments (err, linkString).

    Definition Classes
    Fs
    Example:
    1. fs.readlink(path[, options], callback)

  174. def readlinkSync(path: Path): String
    Definition Classes
    Fs
  175. def readlinkSync(path: Path, options: FileEncodingOptions): Output
    Definition Classes
    Fs
  176. def readlinkSync(path: Path, options: String): Output

    Synchronous readlink(2).

    Synchronous readlink(2).

    path

    the path (Buffer | String)

    options

    the optional options argument can be a string specifying an encoding, or an object with an encoding property specifying the character encoding to use for the link path passed to the callback. If the encoding is set to 'buffer', the link path returned will be passed as a Buffer object.

    returns

    the symbolic link's string value.

    Definition Classes
    Fs
  177. def realpath(path: Path, callback: FsCallback1[String]): Unit

    Asynchronous realpath(2).

    Asynchronous realpath(2). The callback gets two arguments (err, resolvedPath). May use process.cwd to resolve relative paths.

    The optional options argument can be a string specifying an encoding, or an object with an encoding property specifying the character encoding to use for the path passed to the callback. If the encoding is set to 'buffer', the path returned will be passed as a Buffer object.

    Definition Classes
    Fs
    Example:
    1. fs.realpath(path[, options], callback)

  178. def realpath(path: Path, options: FileEncodingOptions, callback: FsCallback1[Output]): Unit
    Definition Classes
    Fs
  179. def realpath(path: Path, options: String, callback: FsCallback1[Output]): Unit

    Asynchronous realpath(2).

    Asynchronous realpath(2). May use process.cwd to resolve relative paths.

    path

    the path

    options

    The optional options argument can be a string specifying an encoding, or an object with an encoding property specifying the character encoding to use for the path passed to the callback.

    callback

    The callback gets two arguments (err, resolvedPath). If the encoding is set to 'buffer', the path returned will be passed as a Buffer object.

    Definition Classes
    Fs
    Example:
    1. fs.realpath(path[, options], callback)

  180. val realpath: RealpathObject
    Definition Classes
    Fs
  181. def realpathSync(path: Path): String
    Definition Classes
    Fs
  182. def realpathSync(path: Path, options: FileEncodingOptions): Output

    Synchronous realpath(3).

    Synchronous realpath(3). Only paths that can be converted to UTF8 strings are supported. The optional options argument can be a string specifying an encoding, or an object with an encoding property specifying the character encoding to use for the returned value. If the encoding is set to 'buffer', the path returned will be passed as a Buffer object.

    returns

    the resolved path.

    Definition Classes
    Fs
    Example:
    1. fs.realpathSync(path[, options])

  183. def rename(oldPath: Path, newPath: Path, callback: FsCallback0): Unit

    Asynchronous rename(2).

    Asynchronous rename(2). No arguments other than a possible exception are given to the completion callback.

    Definition Classes
    Fs
    Example:
    1. fs.rename(oldPath, newPath, callback)

  184. def renameSync(oldPath: Path, newPath: Path): Unit

    Synchronous rename(2).

    Synchronous rename(2).

    returns

    undefined.

    Definition Classes
    Fs
    Example:
    1. fs.renameSync(oldPath, newPath)

  185. def rmdir(path: Path, options: RmdirOptions, callback: FsCallback0): Unit
    Definition Classes
    Fs
  186. def rmdir(path: Path, callback: FsCallback0): Unit

    Asynchronous rmdir(2).

    Asynchronous rmdir(2). No arguments other than a possible exception are given to the completion callback.

    Definition Classes
    Fs
    Example:
    1. fs.rmdir(path, callback)

  187. def rmdirSync(path: Path, options: RmdirOptions): Unit
    Definition Classes
    Fs
  188. def rmdirSync(path: Path): Unit

    Synchronous rmdir(2rmdir).

    Synchronous rmdir(2rmdir).

    returns

    undefined.

    Definition Classes
    Fs
    Example:
    1. fs.rmdirSync(path)

  189. def stat(path: Path, options: StatOptions, callback: FsCallback1[StatsVariant]): StatsVariant
    Definition Classes
    Fs
  190. def stat(path: Path, callback: FsCallback1[Stats]): Stats

    Asynchronous stat(2).

    Asynchronous stat(2). The callback gets two arguments (err, stats) where stats is a fs.Stats object. See the fs.Stats section for more information.

    Definition Classes
    Fs
    Example:
    1. fs.stat(path, callback)

  191. def statSync(path: Path, options: StatOptions): StatsVariant
    Definition Classes
    Fs
  192. def statSync(path: Path): Stats

    Synchronous stat(2).

    Synchronous stat(2). Returns an instance of fs.Stats.

    Definition Classes
    Fs
    Example:
    1. fs.statSync(path)

  193. def symlink(target: Path, path: Path, callback: FsCallback0): Unit

    Asynchronous symlink(2).

    Asynchronous symlink(2). No arguments other than a possible exception are given to the completion callback. The type argument can be set to 'dir', 'file', or 'junction' (default is 'file') and is only available on Windows (ignored on other platforms). Note that Windows junction points require the destination path to be absolute. When using 'junction', the target argument will automatically be normalized to absolute path.

    Definition Classes
    Fs
    Example:
    1. fs.symlink(target, path[, type], callback)

  194. def symlink(target: Path, path: Path, type: String, callback: FsCallback0): Unit

    Asynchronous symlink(2).

    Asynchronous symlink(2). No arguments other than a possible exception are given to the completion callback. The type argument can be set to 'dir', 'file', or 'junction' (default is 'file') and is only available on Windows (ignored on other platforms). Note that Windows junction points require the destination path to be absolute. When using 'junction', the target argument will automatically be normalized to absolute path.

    Definition Classes
    Fs
    Example:
    1. fs.symlink(target, path[, type], callback)

  195. def symlinkSync(target: Path, path: Path): Unit
    Definition Classes
    Fs
  196. def symlinkSync(target: Path, path: Path, type: String): Unit

    Synchronous symlink(2).

    Synchronous symlink(2).

    returns

    undefined.

    Definition Classes
    Fs
    Example:
    1. fs.symlinkSync(target, path[, type])

  197. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  198. def toLocaleString(): String
    Definition Classes
    Object
  199. def toString(): String
    Definition Classes
    AnyRef → Any
  200. def truncate(path: Path, callback: FsCallback0): Unit
    Definition Classes
    Fs
  201. def truncate(path: Path, length: Int, callback: FsCallback0): Unit

    Asynchronous truncate(2).

    Asynchronous truncate(2). No arguments other than a possible exception are given to the completion callback. A file descriptor can also be passed as the first argument. In this case, fs.ftruncate() is called.

    path

    the path <String> | <Buffer>

    length

    the length

    callback

    the completion callback.

    Definition Classes
    Fs
    Example:
    1. fs.truncate(path, length, callback)

  202. def truncateSync(path: Path): Unit
    Definition Classes
    Fs
  203. def truncateSync(path: Path, length: Int): Unit

    Synchronous truncate(2).

    Synchronous truncate(2). In this case, fs.ftruncateSync() is called.

    path

    the path or file descriptor - <String> | <Buffer> | <Integer>

    length

    the length

    returns

    undefined.

    Definition Classes
    Fs
    Example:
    1. fs.truncateSync(path, length)

  204. def unlink(path: Path, callback: FsCallback0): Unit

    Asynchronous unlink(2).

    Asynchronous unlink(2). No arguments other than a possible exception are given to the completion callback.

    Definition Classes
    Fs
    Example:
    1. fs.unlink(path, callback)

  205. def unlinkSync(path: Path): Unit

    Synchronous unlink(2).

    Synchronous unlink(2).

    returns

    undefined.

    Definition Classes
    Fs
    Example:
    1. fs.unlinkSync(path)

  206. def unwatchFile(path: Path): Unit
    Definition Classes
    Fs
  207. def unwatchFile(path: Path, listener: FsCallback0): Unit

    Stop watching for changes on filename.

    Stop watching for changes on filename. If listener is specified, only that particular listener is removed. Otherwise, all listeners are removed and you have effectively stopped watching filename.

    Calling fs.unwatchFile() with a filename that is not being watched is a no-op, not an error.

    Note: fs.watch() is more efficient than fs.watchFile() and fs.unwatchFile(). fs.watch() should be used instead of fs.watchFile() and fs.unwatchFile() when possible.

    Definition Classes
    Fs
    Example:
    1. fs.unwatchFile(filename[, listener])

  208. def utimes(path: Path, atime: Time, mtime: Time, callback: FsCallback0): Unit

    Change file timestamps of the file referenced by the supplied path.

    Change file timestamps of the file referenced by the supplied path.

    Note: the arguments atime and mtime of the following related functions does follow the below rules:

    If the value is a numberable string like '123456789', the value would get converted to corresponding number. If the value is NaN or Infinity, the value would get converted to Date.now().

    Definition Classes
    Fs
    Example:
    1. fs.utimes(path, atime, mtime, callback)

  209. def utimesSync(path: Path, atime: Time, mtime: Time): Unit

    Synchronous version of fs.utimes().

    Synchronous version of fs.utimes().

    returns

    undefined.

    Definition Classes
    Fs
    Example:
    1. fs.utimesSync(path, atime, mtime)

  210. def valueOf(): Any
    Definition Classes
    Object
  211. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  212. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  213. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  214. def watch(filename: Path): FSWatcher
    Definition Classes
    Fs
  215. def watch(filename: Path, options: FSWatcherOptions): FSWatcher

    Watch for changes on filename, where filename is either a file or a directory.

    Watch for changes on filename, where filename is either a file or a directory. The returned object is a fs.FSWatcher.

    The second argument is optional. If options is provided as a string, it specifies the encoding. Otherwise options should be passed as an object.

    The listener callback gets two arguments (event, filename). event is either 'rename' or 'change', and filename is the name of the file which triggered the event.

    filename

    the filename (Buffer | String)

    options

    the optional settings

    returns

    a FSWatcher

    Definition Classes
    Fs
    Example:
    1. fs.watch(filename[, options][, listener])

  216. def watch(filename: Path, listener: Function2[EventType, String, Any]): FSWatcher

    Watch for changes on filename, where filename is either a file or a directory.

    Watch for changes on filename, where filename is either a file or a directory. The returned object is a fs.FSWatcher.

    The second argument is optional. If options is provided as a string, it specifies the encoding. Otherwise options should be passed as an object.

    The listener callback gets two arguments (event, filename). event is either 'rename' or 'change', and filename is the name of the file which triggered the event.

    filename

    the filename (Buffer | String)

    listener

    the listener callback gets two arguments (eventType, filename). eventType is either 'rename' or 'change', and filename is the name of the file which triggered the event.

    returns

    a FSWatcher

    Definition Classes
    Fs
    Example:
    1. fs.watch(filename[, options][, listener])

  217. def watch(filename: Path, options: FSWatcherOptions, listener: Function2[EventType, String, Any]): FSWatcher

    Watch for changes on filename, where filename is either a file or a directory.

    Watch for changes on filename, where filename is either a file or a directory. The returned object is a fs.FSWatcher.

    The second argument is optional. If options is provided as a string, it specifies the encoding. Otherwise options should be passed as an object.

    The listener callback gets two arguments (event, filename). event is either 'rename' or 'change', and filename is the name of the file which triggered the event.

    filename

    the filename (Buffer | String)

    options

    the optional settings

    listener

    the callback function

    returns

    a FSWatcher

    Definition Classes
    Fs
    Example:
    1. fs.watch(filename[, options][, listener])

  218. def watchFile(filename: Path, listener: Function2[Stats, Stats, Any]): FSStatWatcher

    Watch for changes on filename.

    Watch for changes on filename. The callback listener will be called each time the file is accessed.

    The options argument may be omitted. If provided, it should be an object. The options object may contain a boolean named persistent that indicates whether the process should continue to run as long as files are being watched. The options object may specify an interval property indicating how often the target should be polled in milliseconds. The default is { persistent: true, interval: 5007 }.

    filename

    the filename (Buffer | String)

    listener

    the callback

    Definition Classes
    Fs
  219. def watchFile(filename: Path, options: FileWatcherOptions, listener: Function2[Stats, Stats, Any]): FSStatWatcher

    Watch for changes on filename.

    Watch for changes on filename. The callback listener will be called each time the file is accessed.

    The options argument may be omitted. If provided, it should be an object. The options object may contain a boolean named persistent that indicates whether the process should continue to run as long as files are being watched. The options object may specify an interval property indicating how often the target should be polled in milliseconds. The default is { persistent: true, interval: 5007 }.

    filename

    the filename (Buffer | String)

    options

    the optional settings

    listener

    the callback

    Definition Classes
    Fs
  220. def write(fd: FileDescriptor, string: String, callback: FsCallback2[Int, String]): Unit
    Definition Classes
    Fs
  221. def write(fd: FileDescriptor, string: String, position: Int, callback: FsCallback2[Int, String]): Unit
    Definition Classes
    Fs
  222. def write(fd: FileDescriptor, string: String, position: Int, encoding: String, callback: FsCallback2[Int, String]): Unit

    Write string to the file specified by fd.

    Write string to the file specified by fd. If string is not a string, then the value will be coerced to one. Unlike when writing buffer, the entire string must be written. No substring may be specified. This is because the byte offset of the resulting data may not be the same as the string offset. Note that it is unsafe to use fs.write multiple times on the same file without waiting for the callback. For this scenario, fs.createWriteStream is strongly recommended. On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the position argument and always appends the data to the end of the file.

    fd

    the file descriptor

    string

    the data to write

    position

    refers to the offset from the beginning of the file where this data should be written. If typeof position !== 'number' the data will be written at the current position. See pwrite(2).

    encoding

    is the expected string encoding.

    callback

    will receive the arguments (err, written, string) where written specifies how many bytes the passed string required to be written. Note that bytes written is not the same as string characters. See Buffer.byteLength.

    Definition Classes
    Fs
    Example:
    1. fs.write(fd, string[, position[, encoding]], callback)
  223. def write(fd: FileDescriptor, buffer: BufferLike, offset: |[Int, Null], length: |[Int, Null], position: |[Int, Null], callback: FsCallback2[Int, Buffer]): Unit
    Definition Classes
    Fs
  224. def write(fd: FileDescriptor, buffer: Uint8Array, offset: |[Int, Null], length: |[Int, Null], position: |[Int, Null], callback: FsCallback2[Int, Buffer]): Unit

    Write buffer to the file specified by fd.

    Write buffer to the file specified by fd.

    Note: that it is unsafe to use fs.write multiple times on the same file without waiting for the callback. For this scenario, fs.createWriteStream is strongly recommended.

    On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the position argument and always appends the data to the end of the file.

    fd

    the file descriptor

    buffer

    the buffer containing the data to write

    offset

    determines the part of the buffer to be written, and length is an integer specifying the number of bytes to write.

    length

    the optional length of the data to write

    position

    refers to the offset from the beginning of the file where this data should be written. If typeof position !== 'number', the data will be written at the current position. See pwrite(2).

    callback

    will be given three arguments (err, written, buffer) where written specifies how many bytes were written from buffer.

    Definition Classes
    Fs
    Example:
    1. fs.write(fd, buffer[, offset[, length[, position]]], callback)
  225. def writeFile(file: String, data: BufferLike, callback: FsCallback0): Unit
    Definition Classes
    Fs
  226. def writeFile(file: String, data: BufferLike, options: FileWriteOptions, callback: FsCallback0): Unit
    Definition Classes
    Fs
  227. def writeFile(file: String, data: String, callback: FsCallback0): Unit
    Definition Classes
    Fs
  228. def writeFile(file: String, data: String, options: FileWriteOptions, callback: FsCallback0): Unit
    Definition Classes
    Fs
  229. def writeFile(file: String, data: Uint8Array, callback: FsCallback0): Unit
    Definition Classes
    Fs
  230. def writeFile(file: String, data: Uint8Array, options: FileWriteOptions, callback: FsCallback0): Unit

    Asynchronously writes data to a file, replacing the file if it already exists.

    Asynchronously writes data to a file, replacing the file if it already exists. data can be a string or a buffer. The encoding option is ignored if data is a buffer. It defaults to 'utf8'

    Definition Classes
    Fs
    Example:
    1. fs.writeFile(file, data[, options], callback)

  231. def writeFileSync(file: FileDescriptor, data: BufferLike): Unit
    Definition Classes
    Fs
  232. def writeFileSync(file: FileDescriptor, data: BufferLike, options: FileWriteOptions): Unit
    Definition Classes
    Fs
  233. def writeFileSync(file: FileDescriptor, data: String): Unit
    Definition Classes
    Fs
  234. def writeFileSync(file: FileDescriptor, data: String, options: FileWriteOptions): Unit
    Definition Classes
    Fs
  235. def writeFileSync(file: FileDescriptor, data: Uint8Array): Unit
    Definition Classes
    Fs
  236. def writeFileSync(file: FileDescriptor, data: Uint8Array, options: FileWriteOptions): Unit
    Definition Classes
    Fs
  237. def writeFileSync(file: Path, data: BufferLike): Unit
    Definition Classes
    Fs
  238. def writeFileSync(file: Path, data: BufferLike, options: FileWriteOptions): Unit
    Definition Classes
    Fs
  239. def writeFileSync(file: Path, data: String): Unit
    Definition Classes
    Fs
  240. def writeFileSync(file: Path, data: String, options: FileWriteOptions): Unit
    Definition Classes
    Fs
  241. def writeFileSync(file: Path, data: Uint8Array): Unit
    Definition Classes
    Fs
  242. def writeFileSync(file: Path, data: Uint8Array, options: FileWriteOptions): Unit

    The synchronous version of fs.writeFile().

    The synchronous version of fs.writeFile().

    returns

    undefined.

    Definition Classes
    Fs
    Example:
    1. fs.writeFileSync(file, data[, options])

  243. def writeSync(fd: FileDescriptor, data: String): Unit
    Definition Classes
    Fs
  244. def writeSync(fd: FileDescriptor, data: String, encoding: String): Unit
    Definition Classes
    Fs
  245. def writeSync(fd: FileDescriptor, data: String, position: Int): Unit
    Definition Classes
    Fs
  246. def writeSync(fd: FileDescriptor, data: String, position: Int, encoding: String): Unit

    Write string to the file specified by fd.

    Write string to the file specified by fd.

    fd

    the given file descriptor

    data

    the given string

    position

    refers to the offset from the beginning of the file where this data should be written.

    encoding

    is the expected string encoding.

    Definition Classes
    Fs
    Example:
    1. fs.writeSync(fd, string[, position[, encoding]])
  247. def writeSync(fd: FileDescriptor, buffer: BufferLike): Unit
    Definition Classes
    Fs
  248. def writeSync(fd: FileDescriptor, buffer: BufferLike, offset: Int): Unit
    Definition Classes
    Fs
  249. def writeSync(fd: FileDescriptor, buffer: BufferLike, offset: Int, length: Int): Unit
    Definition Classes
    Fs
  250. def writeSync(fd: FileDescriptor, buffer: BufferLike, offset: Int, length: Int, position: Int): Unit
    Definition Classes
    Fs
  251. def writeSync(fd: FileDescriptor, buffer: Uint8Array): Unit
    Definition Classes
    Fs
  252. def writeSync(fd: FileDescriptor, buffer: Uint8Array, offset: Int): Unit
    Definition Classes
    Fs
  253. def writeSync(fd: FileDescriptor, buffer: Uint8Array, offset: Int, length: Int): Unit
    Definition Classes
    Fs
  254. def writeSync(fd: FileDescriptor, buffer: Uint8Array, offset: Int, length: Int, position: Int): Unit

    Write buffer to the file specified by fd.

    Write buffer to the file specified by fd.

    fd

    the given file descriptor

    buffer

    the given buffer

    offset

    determines the part of the buffer to be written, and length is an integer specifying the number of bytes to write.

    length

    the optional length of the data to write

    position

    refers to the offset from the beginning of the file where this data should be written.

    Definition Classes
    Fs
    Example:
    1. fs.writeSync(fd, buffer[, offset[, length[, position]]])
  255. def writev(fd: FileDescriptor, buffers: Array[ArrayBufferView], position: Int, fsCallback2: FsCallback2[Int, Array[ArrayBufferView]]): Unit
    Definition Classes
    Fs
  256. def writevSync(fd: FileDescriptor, buffers: Array[ArrayBufferView]): Unit
    Definition Classes
    Fs
  257. def writevSync(fd: FileDescriptor, buffers: Array[ArrayBufferView], position: Int): Unit
    Definition Classes
    Fs

Inherited from Fs

Inherited from FSConstants

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped