new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Deno · Reference · all subjects

api/file

13 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Deno.File renamed to Deno.FsFile

Deno.File type has been removed. Use Deno.FsFile instead. Change function foo(file: Deno.File) to function foo(file: Deno.FsFile).

Deno.FsFile.prototype.rid and instance methods replacement

Deno.FsFile.prototype.rid has been removed. Use Deno.FsFile instance methods instead. Replace await Deno.read(file.rid, buffer) with await file.read(buffer), await Deno.write(file.rid, data) with await file.write(data), and Deno.close(file.rid) with file.close().

Deno.fstat() replaced with FsFile.stat()

Deno.fstat(rid) has been removed. Use Deno.FsFile.prototype.stat() instead. Change const fileInfo = await Deno.fstat(file.rid) to const fileInfo = await file.stat().

Deno.fsyncSync() replaced with FsFile.syncSync()

Deno.fsyncSync(rid) has been removed. Use Deno.FsFile.prototype.syncSync() instead. Change Deno.fsyncSync(file.rid) to file.syncSync().

Deno.ftruncateSync() replaced with FsFile.truncateSync()

Deno.ftruncateSync(rid, len) has been removed. Use Deno.FsFile.prototype.truncateSync(len) instead. Change Deno.ftruncateSync(file.rid, 7) to file.truncateSync(7).

Deno.ftruncate() replaced with FsFile.truncate()

Deno.ftruncate(rid, len) has been removed. Use Deno.FsFile.prototype.truncate(len) instead. Change await Deno.ftruncate(file.rid, 7) to await file.truncate(7).

Deno.funlock() replaced with FsFile.unlock()

Deno.funlock(rid) has been removed. Use Deno.FsFile.prototype.unlock() instead. Change await Deno.funlock(file.rid) to await file.unlock().

Deno.funlockSync() replaced with FsFile.unlockSync()

Deno.funlockSync(rid) has been removed. Use Deno.FsFile.prototype.unlockSync() instead. Change Deno.funlockSync(file.rid) to file.unlockSync().

Deno.futimeSync() replaced with FsFile.utimeSync()

Deno.futimeSync(rid, atime, mtime) has been removed. Use Deno.FsFile.prototype.utimeSync(atime, mtime) instead. Change Deno.futimeSync(file.rid, 1556495550, new Date()) to file.utimeSync(1556495550, new Date()).

Deno.futime() replaced with FsFile.utime()

Deno.futime(rid, atime, mtime) has been removed. Use Deno.FsFile.prototype.utime(atime, mtime) instead. Change await Deno.futime(file.rid, 1556495550, new Date()) to await file.utime(1556495550, new Date()).

Deno.seek() replaced with FsFile.seek()

Deno.seek(rid, offset, whence) has been removed. Use Deno.FsFile.prototype.seek(offset, whence) instead. Change await Deno.seek(file.rid, 6, Deno.SeekMode.Start) to await file.seek(6, Deno.SeekMode.Start).

new Deno.FsFile() constructor removed

The new Deno.FsFile() constructor has been removed. Use Deno.openSync() or Deno.open() instead. Change const file = new Deno.FsFile(3) to using file = await Deno.open("/foo/bar.txt").

File locking advisory locks

Deno.FsFile supports advisory file locking to coordinate access between processes: lock(exclusive?) acquires a lock (shared/read by default; pass true for exclusive/write; blocks if incompatible lock held), lockSync(exclusive?) is synchronous variant, tryLock(exclusive?) is non-blocking returning true if acquired false otherwise (added Deno 2.7), tryLockSync(exclusive?) is synchronous variant of tryLock.

Give your agent this brain