FsFile$Typings extension

on

Properties

readable ReadableStream<Uint8List>
A {@linkcode ReadableStream} instance representing to the byte contents of the file. This makes it easy to interoperate with other web streams based APIs.
no setter
rid num
The resource ID associated with the file instance. The resource ID should be considered an opaque reference to resource.
no setter
writable WritableStream<Uint8List>
A {@linkcode WritableStream} instance to write the contents of the file. This makes it easy to interoperate with other web streams based APIs.
no setter

Methods

close() → void
Close the file. Closing a file when you are finished with it is important to avoid leaking resources.
read(Uint8List p) Future<num?>
Read the file into an array buffer (p).
readSync(Uint8List p) num?
Synchronously read from the file into an array buffer (p).
seek(Object offset, SeekMode whence) Future<num>
Seek to the given offset under mode given by whence. The call resolves to the new position within the resource (bytes from the start).
seekSync(Object offset, SeekMode whence) num
Synchronously seek to the given offset under mode given by whence. The new position within the resource (bytes from the start) is returned.
stat() Future<FileInfo>
Resolves to a {@linkcode Deno.FileInfo} for the file.
statSync() FileInfo
Synchronously returns a {@linkcode Deno.FileInfo} for the file.
truncate([num? len]) Future<void>
Truncates (or extends) the file to reach the specified len. If len is not specified, then the entire file contents are truncated.
truncateSync([num? len]) → void
Synchronously truncates (or extends) the file to reach the specified len. If len is not specified, then the entire file contents are truncated.
write(Uint8List p) Future<num>
Write the contents of the array buffer (p) to the file.
writeSync(Uint8List p) num
Synchronously write the contents of the array buffer (p) to the file.