Static variables

staticfinalread onlystderr:File

staticfinalread onlystdin:File

staticfinalread onlystdout:File

Static methods

@:noExprstaticaccess(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.

@:noExprstaticchmod(loop:Loop, path:NativeString, mode:Array<FileMode>, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Changes permissions of the file at the given path.

@:noExprstaticchown(loop:Loop, path:NativeString, uid:Int, gid:Int, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Changes owneship of the file at the given path.

@:noExprstaticclose(this:File, loop:Loop, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Closes the file.

@:noExprstaticcopyFile(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.

@:noExprstaticcreateRequest():FileRequest

@:noExprstaticfchmod(this:File, loop:Loop, mode:Array<FileMode>, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Changes permissions of the file.

@:noExprstaticfchown(this:File, loop:Loop, uid:Int, gid:Int, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Changes owneship of the file.

@:noExprstaticfdataSync(this:File, loop:Loop, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Like eval.luv.File.fsync, but may omit some metadata.

@:noExprstaticfstat(this:File, loop:Loop, ?request:FileRequest, callback:(result:Result<FileStat>) ‑> Void):Void

Retrieves status information for this file.

@:noExprstaticfsync(this:File, loop:Loop, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Flushes file changes to storage.

@:noExprstaticftruncate(this:File, loop:Loop, length:Int64, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Truncates the given file to the given length.

@:noExprstaticfutime(this:File, loop:Loop, atime:Float, mtime:Float, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Sets timestamps of the file.

@:noExprstaticlchown(loop:Loop, path:NativeString, uid:Int, gid:Int, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Changes owneship of the file at the given path. without dereferencing symlinks.

@:noExprstaticlink(loop:Loop, path:NativeString, link:NativeString, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Hardlinks a file at the location given by link.

@:noExprstaticlstat(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<FileStat>) ‑> Void):Void

Like eval.luv.File.stat, but does not dereference symlinks.

@:noExprstaticlutime(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.

@:noExprstaticmkdir(loop:Loop, path:NativeString, ?mode:Array<FileMode>, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Creates a directory.

@:noExprstaticmkdtemp(loop:Loop, pattern:NativeString, ?request:FileRequest, callback:(result:Result<NativeString>) ‑> Void):Void

Creates a temporary directory with name based on the given pattern.

@:noExprstaticmkstemp(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.

@:noExprstaticopen(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.

@:noExprstaticread(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.

@:noExprstaticreadLink(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<NativeString>) ‑> Void):Void

Reads the target path of a symlink.

@:noExprstaticrealPath(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<NativeString>) ‑> Void):Void

Resolves a real absolute path to the given file.

@:noExprstaticrename(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

@:noExprstaticrmdir(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Deletes a directory.

@:noExprstaticsendFile(this:File, loop:Loop, toFile:File, offset:Int64, length:UInt64, ?request:FileRequest, callback:(result:Result<UInt64>) ‑> Void):Void

Transfers data between file descriptors.

@:noExprstaticstat(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<FileStat>) ‑> Void):Void

Retrieves status information for the file at the given path.

@:noExprstaticstatFs(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<FileStatFs>) ‑> Void):Void

Retrieves status information for the filesystem containing the given path.

@:noExprstaticsymlink(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.

@:noExprstatictestMode(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.

@:noExprstatictoInt(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.

@:noExprstaticunlink(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result<NoData>) ‑> Void):Void

Deletes the file at the given path.

@:noExprstaticutime(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.

@:noExprstaticwrite(this:File, loop:Loop, fileOffset:Int64, buffers:Array<Buffer>, ?request:FileRequest, callback:(result:Result<UInt64>) ‑> Void):Void

Writes to the file.