IO Extensions
FS
Crate features: [
fs
,io_extensions
] https://crates.io/crates/deno_fs
Populates a large number of filesystem functions under Deno.*
:
Not sandbox safe. Off by default
Full list of functions:
writeFileSync
writeFile
writeTextFileSync
writeTextFile
readTextFile
readTextFileSync
readFile
readFileSync
watchFs
chmodSync
chmod
chown
chownSync
copyFileSync
cwd
makeTempDirSync
makeTempDir
makeTempFileSync
makeTempFile
mkdirSync
mkdir
chdir
copyFile
readDirSync
readDir
readLinkSync
readLink
realPathSync
realPath
removeSync
remove
renameSync
rename
statSync
lstatSync
stat
lstat
truncateSync
truncate
FsFile
open
openSync
create
createSync
symlink
symlinkSync
link
linkSync
utime
utimeSync
umask
Permissions
This extension is affected by the following methods in the permissions trait:
check_open
- Check if a given path is allowed to be opened
check_read_all
- Can be used to disable all read operationscheck_read
- Check if a given path is allowed to be readcheck_read_blind
-check_read
, but is expected to use thedisplay
argument to anonymize the path
check_write_all
- Can be used to disable all write operationscheck_write
- Check if a given path is allowed to be written tocheck_write_blind
-check_write
, but is expected to use thedisplay
argument to anonymize the pathcheck_write_partial
- Used to check if a given path is allowed to be written to partially (non-recursive removes, use this)
Usage Example
const file = Deno.openSync("/dev/zero");
const buf = new Uint8Array(100);
file.readSync(buf);
const file = Deno.openSync("/dev/null", { write: true });
file.writeSync(buf);