object Fs extends Object with Fs
File System Singleton
- Annotations
- @native() @JSImport( "fs" , JSImport.Namespace )
- Alphabetic
- By Inheritance
- Fs
- Fs
- IEventEmitter
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
FSWatcher: Function1[String, FSWatcher]
TODO find documentation
TODO find documentation
- Definition Classes
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
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
- Fs
-
val
R_OK: FileMode
File can be read by the calling process.
File can be read by the calling process.
- Definition Classes
- Fs
-
def
ReadStream: Function1[String, ReadStream]
TODO find documentation
TODO find documentation
- Definition Classes
- Fs
-
val
S_IFBLK: FileType
File type constant for a block-oriented device file.
File type constant for a block-oriented device file.
- Definition Classes
- Fs
-
val
S_IFCHR: FileType
File type constant for a character-oriented device file.
File type constant for a character-oriented device file.
- Definition Classes
- Fs
-
val
S_IFDIR: FileType
File type constant for a directory.
File type constant for a directory.
- Definition Classes
- Fs
-
val
S_IFIFO: FileType
File type constant for a FIFO/pipe.
File type constant for a FIFO/pipe.
- Definition Classes
- Fs
-
val
S_IFLNK: FileType
File type constant for a symbolic link.
File type constant for a symbolic link.
- Definition Classes
- Fs
-
val
S_IFMT: FileType
Bit mask used to extract the file type code.
Bit mask used to extract the file type code.
- Definition Classes
- Fs
-
val
S_IFREG: FileType
File type constant for a regular file.
File type constant for a regular file.
- Definition Classes
- Fs
-
val
S_IFSOCK: FileType
File type constant for a socket.
File type constant for a socket.
- Definition Classes
- Fs
-
val
W_OK: FileMode
File can be written by the calling process.
File can be written by the calling process.
- Definition Classes
- Fs
-
def
WriteStream: Function1[String, WriteStream]
TODO find documentation
TODO find documentation
- Definition Classes
- Fs
-
val
X_OK: FileMode
File can be executed by the calling process.
-
def
access(path: |[String, Buffer], callback: Function): 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.
- fs.R_OK - File can be read by the calling process.
- fs.W_OK - File can be written by the calling process.
- fs.X_OK - File can be executed by the calling process. This has no effect on Windows (will behave like fs.F_OK).
- path
the path (String | Buffer)
- 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
fs.access(path[, mode], callback)
Example: -
def
access(path: |[String, Buffer], mode: FileMode, callback: Function): 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.
- fs.R_OK - File can be read by the calling process.
- fs.W_OK - File can be written by the calling process.
- fs.X_OK - File can be executed by the calling process. This has no effect on Windows (will behave like fs.F_OK).
- path
the path (String | Buffer)
- 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
fs.access(path[, mode], callback)
Example: -
def
accessSync(path: |[String, Buffer], mode: FileMode = null): 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 (String | Buffer)
- mode
the optional mode
- Definition Classes
- Fs
fs.accessSync(path[, mode])
Example: -
def
addListener(eventName: String, listener: Function): Fs.this.type
Alias for emitter.on(eventName, listener).
Alias for emitter.on(eventName, listener).
- Definition Classes
- IEventEmitter
emitter.addListener(eventName, listener)
- See also
on()
Example: -
def
appendFile(file: |[|[String, Buffer], Int], data: |[String, Buffer], callback: Function): 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 (String | Buffer | Number)
- data
the data to append (String | Buffer)
- callback
the callback function
- Definition Classes
- Fs
fs.appendFile(file, data[, options], callback)
Example: -
def
appendFile(file: |[|[String, Buffer], Int], data: |[String, Buffer], options: |[AppendOptions, RawOptions], callback: Function): 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 (String | Buffer | Number)
- data
the data to append (String | Buffer)
- options
the optional append options
- callback
the callback function
- Definition Classes
- Fs
fs.appendFile(file, data[, options], callback)
Example: -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
close(fd: FileDescriptor, callback: Function): Unit
Asynchronous close(2).
Asynchronous close(2). No arguments other than a possible exception are given to the completion callback.
- Definition Classes
- Fs
fs.close(fd, callback)
Example: -
def
closeSync(fd: FileDescriptor): Unit
Synchronous close(2).
Synchronous close(2). Returns undefined.
- Definition Classes
- Fs
fs.closeSync(fd)
Example: -
def
createReadStream(path: |[String, Buffer], options: |[FileInputOptions, RawOptions] = js.native): Readable
Returns a new ReadStream object.
Returns a new ReadStream object. (See Readable Stream).vBe 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 (String | Buffer)
- options
the optional stream options
- Definition Classes
- Fs
fs.createReadStream(path[, options])
Example: -
def
createWriteStream(path: |[String, Buffer], options: |[FileOutputOptions, RawOptions] = js.native): Writable
Returns a new WriteStream object.
Returns a new WriteStream object.
- path
the path (String | Buffer)
- options
the optional stream options
- Definition Classes
- Fs
fs.createWriteStream(path[, options])
- See also
Writable
Example: -
val
domain: String
- Definition Classes
- IEventEmitter
-
def
emit(name: String, args: Any*): Any
Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.
Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.
Returns true if the event had listeners, false otherwise.
- name
the event name
- args
the event arguments
- Definition Classes
- IEventEmitter
emitter.emit(name[, arg1][, arg2][, ...])
Example: -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
fchmod(fd: FileDescriptor, mode: FileMode, callback: Function): Unit
Asynchronous fchmod(2).
Asynchronous fchmod(2). No arguments other than a possible exception are given to the completion callback.
- Definition Classes
- Fs
fs.fchmod(fd, mode, callback)
Example: -
def
fchmodSync(fd: FileDescriptor, mode: FileMode): Unit
Synchronous fchmod(2).
Synchronous fchmod(2). Returns undefined.
- Definition Classes
- Fs
fs.fchmodSync(fd, mode)
Example: -
def
fdatasync(fd: FileDescriptor, callback: Function): Unit
Asynchronous fdatasync(2).
Asynchronous fdatasync(2). No arguments other than a possible exception are given to the completion callback.
- Definition Classes
- Fs
fs.fdatasync(fd, callback)
Example: -
def
fdatasyncSync(fd: FileDescriptor): Unit
Synchronous fdatasync(2).
Synchronous fdatasync(2). Returns undefined.
- Definition Classes
- Fs
fs.fdatasyncSync(fd)
Example: -
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
futimes(fd: FileDescriptor, atime: Integer, mtime: Integer, 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
fs.futimes(fd, atime, mtime, callback)
Example: -
def
futimesSync(fd: FileDescriptor, atime: Integer, mtime: Integer): Unit
Synchronous version of fs.futimes().
Synchronous version of fs.futimes(). Returns undefined.
- Definition Classes
- Fs
fs.futimesSync(fd, atime, mtime)
Example: -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getMaxListeners(): Int
Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to EventEmitter.defaultMaxListeners.
Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to EventEmitter.defaultMaxListeners.
- Definition Classes
- IEventEmitter
emitter.getMaxListeners()
- See also
setMaxListeners()
Example: -
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
def
lchmod(path: |[String, Buffer], mode: FileMode, callback: Function): Unit
Asynchronous lchmod(2).
Asynchronous lchmod(2). No arguments other than a possible exception are given to the completion callback.
- Definition Classes
- Fs
fs.lchmod(path, mode, callback)
Example: -
def
lchmodSync(path: |[String, Buffer], mode: FileMode): Unit
Synchronous lchmod(2).
Synchronous lchmod(2). Returns undefined.
- path
the path (String | Buffer)
- mode
the mode (Integer)
- Definition Classes
- Fs
fs.lchmodSync(path, mode)
Example: -
def
lchown(path: |[String, Buffer], uid: Integer, gid: Integer, callback: Function): Unit
Asynchronous lchown(2).
Asynchronous lchown(2). No arguments other than a possible exception are given to the completion callback.
- path
the path (String | Buffer)
- uid
the user ID
- gid
the group ID
- callback
the completion callback.
- Definition Classes
- Fs
fs.lchown(path, uid, gid, callback)
Example: -
def
lchownSync(path: |[String, Buffer], uid: Integer, gid: Integer): Unit
Synchronous chown(2).
Synchronous chown(2). Returns undefined.
- path
the path (String | Buffer)
- uid
the user ID
- gid
the group ID
- Definition Classes
- Fs
-
def
link(srcpath: |[String, Buffer], dstpath: |[String, Buffer], callback: Function): Unit
Asynchronous link(2).
Asynchronous link(2). No arguments other than a possible exception are given to the completion callback.
- Definition Classes
- Fs
fs.link(srcpath, dstpath, callback)
Example: -
def
listenerCount(eventName: String): Int
Returns the number of listeners listening to the event named eventName.
Returns the number of listeners listening to the event named eventName.
- Definition Classes
- IEventEmitter
emitter.listenerCount(eventName)
Example: -
def
listeners(eventName: String): Array[Function]
Returns a copy of the array of listeners for the event named eventName.
Returns a copy of the array of listeners for the event named eventName.
- Definition Classes
- IEventEmitter
emitter.listeners(eventName)
Example: -
def
mkdir(path: |[String, Buffer], callback: Function): 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
fs.mkdir(path[, mode], callback)
Example: -
def
mkdir(path: |[String, Buffer], mode: |[FileMode, Any], callback: Function): 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
fs.mkdir(path[, mode], callback)
Example: -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
on(eventName: String, listener: Function): Fs.this.type
Adds the listener function to the end of the listeners array for the event named eventName.
Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.
Returns a reference to the EventEmitter so calls can be chained.
- Definition Classes
- IEventEmitter
emitter.on(eventName, listener)
Example: -
def
once(eventName: String, listener: Function): Fs.this.type
Adds a one time listener function for the event named eventName.
Adds a one time listener function for the event named eventName. This listener is invoked only the next time eventName is triggered, after which it is removed.
- Definition Classes
- IEventEmitter
emitter.once(eventName, listener)
Example: -
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
readFile(file: String, callback: Function): Unit
Asynchronously reads the entire contents of a file.
Asynchronously reads the entire contents of a file.
- Definition Classes
- Fs
fs.readFile(file[, options], callback)
Example: -
def
readFile(file: String, options: |[|[FileInputOptions, RawOptions], String], callback: Function): Unit
Asynchronously reads the entire contents of a file.
Asynchronously reads the entire contents of a file.
- Definition Classes
- Fs
fs.readFile(file[, options], callback)
Example: -
def
readFileSync(file: String, options: |[FileInputOptions, RawOptions] = js.native): Buffer
Synchronous version of fs.readFile.
Synchronous version of fs.readFile. 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
fs.readFileSync(file[, options])
Example: -
def
readFileSync(file: String, encoding: String): String
Synchronous version of fs.readFile.
Synchronous version of fs.readFile. 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
fs.readFileSync(file[, options])
Example: -
def
readFileSync(file: String, encoding: String, options: |[FileInputOptions, RawOptions]): String
Synchronous version of fs.readFile.
Synchronous version of fs.readFile. 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
fs.readFileSync(file[, options])
Example: -
def
realpath(path: String, callback: Function): 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
fs.realpath(path[, options], callback)
Example: -
def
realpath(path: String, options: |[FileEncodingOptions, RawOptions], callback: Function): 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
fs.realpath(path[, options], callback)
Example: -
def
realpathSync(path: String, options: |[FileEncodingOptions, RawOptions] = js.native): String
- Definition Classes
- Fs
fs.realpathSync(path[, options])
Example: -
def
removeAllListeners(): Fs.this.type
Removes all listeners, or those of the specified eventName.
Removes all listeners, or those of the specified eventName.
Note that it is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).
Returns a reference to the EventEmitter so calls can be chained.
- Definition Classes
- IEventEmitter
emitter.removeAllListeners([eventName])
Example: -
def
removeAllListeners(eventName: String): Fs.this.type
Removes all listeners, or those of the specified eventName.
Removes all listeners, or those of the specified eventName.
Note that it is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).
Returns a reference to the EventEmitter so calls can be chained.
- Definition Classes
- IEventEmitter
emitter.removeAllListeners([eventName])
Example: -
def
removeListener(eventName: String, listener: Function): Fs.this.type
Removes the specified listener from the listener array for the event named eventName.
Removes the specified listener from the listener array for the event named eventName. removeListener will remove, at most, one instance of a listener from the listener array. If any single listener has been added multiple times to the listener array for the specified eventName, then removeListener must be called multiple times to remove each instance.
Note that once an event has been emitted, all listeners attached to it at the time of emitting will be called in order. This implies that any removeListener() or removeAllListeners() calls after emitting and before the last listener finishes execution will not remove them from emit() in progress. Subsequent events will behave as expected.
- Definition Classes
- IEventEmitter
emitter.removeListener(eventName, listener)
Example: -
def
rename(oldPath: String, newPath: String, callback: Function): Unit
Asynchronous rename(2).
Asynchronous rename(2). No arguments other than a possible exception are given to the completion callback.
- Definition Classes
- Fs
fs.rename(oldPath, newPath, callback)
Example: -
def
renameSync(oldPath: String, newPath: String): Unit
Synchronous rename(2).
Synchronous rename(2). Returns undefined.
- Definition Classes
- Fs
fs.renameSync(oldPath, newPath)
Example: -
def
rmdir(path: |[String, Buffer], callback: Function): Unit
Asynchronous rmdir(2).
Asynchronous rmdir(2). No arguments other than a possible exception are given to the completion callback.
- Definition Classes
- Fs
fs.rmdir(path, callback)
Example: -
def
rmdirSync(path: |[String, Buffer]): Unit
Synchronous rmdir(2).
Synchronous rmdir(2). Returns undefined.
- Definition Classes
- Fs
fs.rmdirSync(path)
Example: -
def
setMaxListeners(n: Int): Fs.this.type
By default EventEmitters will print a warning if more than 10 listeners are added for a particular event.
By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. Obviously, not all events should be limited to just 10 listeners. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) for to indicate an unlimited number of listeners.
Returns a reference to the EventEmitter so calls can be chained.
- Definition Classes
- IEventEmitter
emitter.setMaxListeners(n)
Example: -
def
stat(path: |[String, Buffer], callback: Function): Stats
Asynchronous stat(2).
-
def
statSync(path: |[String, Buffer]): Stats
Synchronous stat(2).
-
def
symlink(target: |[String, Buffer], path: |[String, Buffer], callback: Function1[FileIOError, Any]): 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
fs.symlink(target, path[, type], callback)
Example: -
def
symlink(target: |[String, Buffer], path: |[String, Buffer], type: String, callback: Function1[FileIOError, Any]): 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
fs.symlink(target, path[, type], callback)
Example: -
def
symlinkSync(target: |[String, Buffer], path: |[String, Buffer], type: String = null): Unit
Synchronous symlink(2).
Synchronous symlink(2). Returns undefined.
- Definition Classes
- Fs
fs.symlinkSync(target, path[, type])
Example: -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unlink(path: |[String, Buffer], callback: Function): Unit
Asynchronous unlink(2).
Asynchronous unlink(2). No arguments other than a possible exception are given to the completion callback.
- Definition Classes
- Fs
fs.unlink(path, callback)
Example: -
def
unlinkSync(path: |[String, Buffer]): Unit
Synchronous unlink(2).
Synchronous unlink(2). Returns undefined.
- Definition Classes
- Fs
fs.unlinkSync(path)
Example: -
def
unwatchFile(filename: |[String, Buffer], listener: Function = null): 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
fs.unwatchFile(filename[, listener])
Example: -
val
usingDomains: Boolean
- Definition Classes
- IEventEmitter
-
def
utimes(path: |[String, Buffer], atime: Int, mtime: Int, callback: Function): 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
fs.utimes(path, atime, mtime, callback)
Example: -
def
utimesSync(path: |[String, Buffer], atime: Int, mtime: Int): Unit
Synchronous version of fs.utimes().
Synchronous version of fs.utimes(). Returns undefined.
- Definition Classes
- Fs
fs.utimesSync(path, atime, mtime)
Example: -
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
watch(filename: String, options: |[FSWatcherOptions, RawOptions] = js.native): Unit
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.
- Definition Classes
- Fs
fs.watch(filename[, options][, listener])
Example: -
def
watch(filename: String, listener: Function): Unit
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.
- Definition Classes
- Fs
fs.watch(filename[, options][, listener])
Example: -
def
watch(filename: String, options: |[FSWatcherOptions, RawOptions], listener: Function): Unit
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.
- Definition Classes
- Fs
fs.watch(filename[, options][, listener])
Example: -
def
writeFile(file: String, data: |[String, Buffer], callback: Function): 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
fs.writeFile(file, data[, options], callback)
Example: -
def
writeFile(file: String, data: |[String, Buffer], options: |[FileOutputOptions, RawOptions], callback: Function): 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
fs.writeFile(file, data[, options], callback)
Example: -
def
writeFileSync(file: String, data: |[String, Buffer], options: |[FileOutputOptions, RawOptions] = js.native): Unit
The synchronous version of fs.writeFile().
The synchronous version of fs.writeFile(). Returns undefined.
- Definition Classes
- Fs
fs.writeFileSync(file, data[, options])
Example:
Deprecated Value Members
-
def
exists(path: String, callback: Function): Unit
Test whether or not the given path exists by checking with the file system.
Test whether or not the given path exists by checking with the file system. Then call the callback argument with either true or false.
- Definition Classes
- Fs
- Annotations
- @deprecated
- Deprecated
(Since version 1.0.0) Use fs.stat() or fs.access() instead.
fs.exists('/etc/passwd', (exists) => { ... })
Example: -
def
existsSync(path: String): 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
- Annotations
- @deprecated
- Deprecated
(Since version 1.0.0) Use fs.statSync() or fs.accessSync() instead.
fs.existsSync(path)
Example: