summaryrefslogtreecommitdiff
path: root/ext/fs/ops.rs
AgeCommit message (Collapse)Author
2024-11-15refactor: use boxed_error in some places (#26887)David Sherret
2024-11-13feat(ext/fs): add ctime to Deno.stats and use it in node compat layer (#24801)Łukasz Czerniawski
This PR fixes #24453, by introducing a ctime (using ctime for UNIX and ChangeTime for Windows) to Deno.stats. Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-11-04refactor(runtime/permissions): use concrete error types (#26464)Leo Kettmeir
2024-10-18refactor(ext/fs): use concrete error types (#26317)Leo Kettmeir
2024-09-28refactor: move NpmCacheDir to deno_cache_dir (#25916)David Sherret
Part of the ongoing work to move more of Deno's resolution out of the CLI crate (for use in Wasm and other things) Includes: * https://github.com/denoland/deno_cache_dir/pull/60
2024-09-16refactor(permissions): split up Descriptor into Allow, Deny, and Query (#25508)David Sherret
This makes the permission system more versatile.
2024-09-12refactor: cleanup unstable checks for WebGPU, FFI and FS APIs (#25586)Asher Gomez
Continuation of work in #25488. --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-10feat(cli): use NotCapable error for permission errors (#25431)Luca Casonato
Closes #7394 --------- Co-authored-by: snek <snek@deno.com>
2024-09-09BREAKING(fs): remove `Deno.fsync[Sync]()` (#25448)Asher Gomez
Towards #22079 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-09BREAKING(fs): remove `Deno.fdatasync[Sync]()` (#25520)Asher Gomez
2024-09-05BREAKING(fs): remove `Deno.funlock[Sync]()` (#25442)Asher Gomez
Towards #22079 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-04BREAKING(fs): remove `Deno.ftruncate[Sync]()` (#25412)Asher Gomez
Towards #22079 Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-03chore(fs): remove `Deno.flock[Sync]()` (#25350)Asher Gomez
Towards #22079
2024-08-20fix(cli): update permission prompt message for compiled binaries (#24081)Yazan AbdAl-Rahman
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-06-08fix(ext/node): lossy UTF-8 read node_modules files (#24140)Luca Casonato
Previously various reads of files in `node_modules` would error on invalid UTF-8. These were cases involving: - reading package.json from Rust - reading package.json from JS - reading CommonJS files from JS - reading CommonJS files from Rust (for ESM translation) - reading ESM files from Rust
2024-05-23feat(ext/fs): stabilize `Deno.FsFile.unlock[Sync]()` and ↵Asher Gomez
`Deno.FsFile.lock[Sync]()` (#23754) Related #22230 CC @dyedgreen
2024-05-22feat(ext/fs): stabilize `Deno.FsFile.syncData[Sync]()` and ↵Asher Gomez
`Deno.FsFile.sync[Sync]()` (#23733) Closes #22230
2024-04-19feat(runtime): Allow embedders to perform additional access checks on file ↵Matt Mastracci
open (#23208) Embedders may have special requirements around file opening, so we add a new `check_open` permission check that is called as part of the file open process.
2024-02-21fix(ext/fs): make errors in tempfile creation clearer (#22498)Matt Mastracci
When using a prefix or suffix containing an invalid filename character, it's not entirely clear where the errors come from. We make these errors more consistent across platforms. In addition, all permission prompts for tempfile and tempdir were printing the same API name. We also take the opportunity to make the tempfile random space larger by 2x (using a base32-encoded u64 rather than a hex-encoded u32).
2024-02-19chore(fs): rename `op_fs_file_stat_{async/sync}` ops (#22476)Asher Gomez
Renames `op_fs_fstat_{sync/async}` to `op_fs_file_stat_{async/sync}` in preparation of the upcoming removal of `Deno.fstat()` in v2.
2024-01-24revert: Remove deprecations of file sync APIs (#22085)Bartek Iwańczuk
- `Deno.FsFile.dataSync` -> `Deno.FsFile.syncData` - `Deno.FsFile.dataSyncSync` -> `Deno.FsFile.syncDataSync` Also marks these APIs as unstable
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-10-04refactor: use deno_core::FeatureChecker for unstable checks (#20765)Bartek Iwańczuk
2023-09-24refactor: rewrite more ops to op2 (#20666)Bartek Iwańczuk
2023-09-23refactor: rewrite ops to op2 macro (#20628)Bartek Iwańczuk
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-09-13chore: bump deno_core and cargo update (#20480)Matt Mastracci
Bump deno_core, pulling in new rusty_v8. Requires some op2/deprecation fixes.
2023-09-07chore(ext/fs): port some ops to op2 (#20402)Matt Mastracci
Port as many of these ops as we can to `op2`. Waiting on a few `deno_core` updates to complete this file.
2023-08-03feat(permissions): add "--deny-*" flags (#19070)Asher Gomez
This commit adds new "--deny-*" permission flags. These are complimentary to "--allow-*" flags. These flags can be used to restrict access to certain resources, even if they were granted using "--allow-*" flags or the "--allow-all" ("-A") flag. Eg. specifying "--allow-read --deny-read" will result in a permission error, while "--allow-read --deny-read=/etc" will allow read access to all FS but the "/etc" directory. Runtime permissions APIs ("Deno.permissions") were adjusted as well, mainly by adding, a new "PermissionStatus.partial" field. This field denotes that while permission might be granted to requested resource, it's only partial (ie. a "--deny-*" flag was specified that excludes some of the requested resources). Eg. specifying "--allow-read=foo/ --deny-read=foo/bar" and then querying for permissions like "Deno.permissions.query({ name: "read", path: "foo/" })" will return "PermissionStatus { state: "granted", onchange: null, partial: true }", denoting that some of the subpaths don't have read access. Closes #18804. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2023-06-22refactor(serde_v8): split ZeroCopyBuf into JsBuffer and ToJsBuffer (#19566)Bartek Iwańczuk
`ZeroCopyBuf` was convenient to use, but sometimes it did hide details that some copies were necessary in certain cases. Also it made it way to easy for the caller to pass around and convert into different values. This commit splits `ZeroCopyBuf` into `JsBuffer` (an array buffer coming from V8) and `ToJsBuffer` (a Rust buffer that will be converted into a V8 array buffer). As a result some magical conversions were removed (they were never used) limiting the API surface and preparing for changes in #19534.
2023-05-24feat(ext/fs): add isBlockDevice, isCharDevice, isFifo, isSocket to FileInfo ↵Hirotaka Tagawa / wafuwafu13
(#19008) `isFile`, `isDirectory`, `isSymlink` are defined in `Deno.FileInfo`, but `isBlockDevice`, `isCharacterDevice`, `isFIFO`, `isSocket` are not defined. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-11fix(ext/fs): add more context_path (#19101)David Sherret
2023-05-08refactor: prefix ops w/ crate they are defined in (#19044)Luca Casonato
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-08refactor(ext/fs): `deno_fs::FileSystem` - conditional `Send + Sync` (#18993)David Sherret
This allows for having a conditional `Send + Sync` on the file system trait for Deploy.
2023-05-04refactor(ext/fs): boxed deno_fs::FileSystem (#18945)David Sherret
1. Boxed `File` and `FileSystem` to allow more easily passing this through the CLI code (as shown within this pr). 2. `StdFileResource` is now `FileResource`. `FileResource` now contains an `Rc<dyn File>`.
2023-04-17chore(ext/fs): decouple fs trait from deno_core (#18732)Luca Casonato
This commit removes the dependencies on `deno_core` for the Fs trait. This allows to move the trait into a different crate that does not depend on core in the limit. This adds a new `bounds` field to `deno_core::extension!` that expands to `where` clauses on the generated code. This allows to add bounds to the extension parameters, such as `Fs::File: Resource`.
2023-04-12refactor(ext/fs): abstract FS via FileSystem trait (#18599)Luca Casonato
This commit abstracts out the specifics of the underlying system calls FS operations behind a new `FileSystem` and `File` trait in the `ext/fs` extension. This allows other embedders to re-use ext/fs, but substituting in a different FS backend. This is likely not the final form of these traits. Eventually they will be entirely `deno_core::Resource` agnostic, and will live in a seperate crate. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>