Static variables
Static methods
staticaccess(loop:Loop, path:NativeString, flags:Array<FileAccessFlag>, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Checks whether the calling process can access the file at the given path.
staticchmod(loop:Loop, path:NativeString, mode:Array<FileMode>, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Changes permissions of the file at the given path.
staticchown(loop:Loop, path:NativeString, uid:Int, gid:Int, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Changes ownership of the file at the given path.
staticclose(this:File, loop:Loop, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Closes the file.
staticcopyFile(loop:Loop, path:NativeString, toPath:NativeString, ?flags:Array<FileCopyFlag>, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Copies the file at the given path to the path given by toPath
.
staticfchmod(this:File, loop:Loop, mode:Array<FileMode>, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Changes permissions of the file.
staticfchown(this:File, loop:Loop, uid:Int, gid:Int, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Changes ownership of the file.
staticfdataSync(this:File, loop:Loop, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Like eval.luv.File.fsync
, but may omit some metadata.
staticfstat(this:File, loop:Loop, ?request:FileRequest, callback:(result:Result<FileStat>) ‑> Void):Void
Retrieves status information for this file.
staticfsync(this:File, loop:Loop, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Flushes file changes to storage.
staticftruncate(this:File, loop:Loop, length:Int64, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Truncates the given file to the given length.
staticfutime(this:File, loop:Loop, atime:Float, mtime:Float, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Sets timestamps of the file.
staticlchown(loop:Loop, path:NativeString, uid:Int, gid:Int, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Changes ownership of the file at the given path. without dereferencing symlinks.
staticlink(loop:Loop, path:NativeString, link:NativeString, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Hardlinks a file at the location given by link
.
staticlstat(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<FileStat>) ‑> Void):Void
Like eval.luv.File.stat
, but does not dereference symlinks.
staticlutime(loop:Loop, path:NativeString, atime:Float, mtime:Float, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Sets timestamps of the file at the given path without dereferencing symlinks.
staticmkdir(loop:Loop, path:NativeString, ?mode:Array<FileMode>, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Creates a directory.
staticmkdtemp(loop:Loop, pattern:NativeString, ?request:FileRequest, callback:(result:Result<NativeString>) ‑> Void):Void
Creates a temporary directory with name based on the given pattern.
staticmkstemp(loop:Loop, pattern:NativeString, ?request:FileRequest, callback:(result:Result<{name:NativeString, file:File}>) ‑> Void):Void
Creates a temporary file with name based on the given pattern.
staticopen(loop:Loop, path:NativeString, flags:Array<FileOpenFlag>, ?mode:Array<FileMode>, ?request:FileRequest, callback:(result:Result<File>) ‑> Void):Void
Opens the file at the given path.
The default value of the mode
argument is equal to octal 0o644
.
staticread(this:File, loop:Loop, fileOffset:Int64, buffers:Array<Buffer>, ?request:FileRequest, callback:(result:Result<UInt64>) ‑> Void):Void
Reads from the file.
The incoming data is written consecutively to into the given buffers. The number of bytes that the operation tries to read is the total length of the buffers.
End of file is indicated by Result.Ok(0)
. Note that this is different
from eval.luv.Stream.readStart
.
staticreadLink(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<NativeString>) ‑> Void):Void
Reads the target path of a symlink.
staticrealPath(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<NativeString>) ‑> Void):Void
Resolves a real absolute path to the given file.
staticrename(loop:Loop, path:NativeString, toPath:NativeString, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Moves the file at the given path to the path given by toPath
staticrmdir(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Deletes a directory.
staticsendFile(this:File, loop:Loop, toFile:File, offset:Int64, length:UInt64, ?request:FileRequest, callback:(result:Result<UInt64>) ‑> Void):Void
Transfers data between file descriptors.
staticstat(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<FileStat>) ‑> Void):Void
Retrieves status information for the file at the given path.
staticstatFs(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<FileStatFs>) ‑> Void):Void
Retrieves status information for the filesystem containing the given path.
staticsymlink(loop:Loop, path:NativeString, link:NativeString, ?flags:Array<FileSymlinkFlag>, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Symlinks a file at the location given by link
.
statictestMode(mask:Array<FileMode>, bits:FileModeNumeric):Bool
Checks whether all the bits in mask
are set in bits
.
For example, if bits
is equal to octal 0o644, then
eval.luv.File.testMode [IRUSR] bits
evaluates to true
.
statictoInt(this:File):Int
Returns the integer representation of eval.luv.File
.
eval.luv.File
is defined as an integer file descriptor by libuv on all
platforms at the moment. This is a convenience function for interoperability
with eval.luv.Process
, the API of which assumes that files are represented
by integers.
staticunlink(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Deletes the file at the given path.
staticutime(loop:Loop, path:NativeString, atime:Float, mtime:Float, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void
Sets timestamps of the file at the given path.