forked from denoland/deno
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ext/fs): abstract FS via FileSystem trait (denoland#18599)
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 <[email protected]>
- Loading branch information
Showing
15 changed files
with
3,350 additions
and
2,488 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
disallowed-methods = [ | ||
{ path = "std::env::current_dir", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::path::Path::canonicalize", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::Path::is_dir", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::Path::is_file", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::Path::is_symlink", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::Path::metadata", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::Path::read_dir", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::Path::read_link", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::Path::symlink_metadata", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::Path::try_exists", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::PathBuf::exists", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::PathBuf::canonicalize", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::PathBuf::is_dir", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::PathBuf::is_file", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::PathBuf::is_symlink", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::PathBuf::metadata", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::PathBuf::read_dir", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::PathBuf::read_link", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::PathBuf::symlink_metadata", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::path::PathBuf::try_exists", reason = "File system operations should be done using NodeFs trait" }, | ||
{ path = "std::env::set_current_dir", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::env::temp_dir", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::canonicalize", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::copy", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::create_dir_all", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::create_dir", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::DirBuilder::new", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::hard_link", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::metadata", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::OpenOptions::new", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::read_dir", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::read_link", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::read_to_string", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::read", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::remove_dir_all", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::remove_dir", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::remove_file", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::rename", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::set_permissions", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::symlink_metadata", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::fs::write", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::path::Path::canonicalize", reason = "File system operations should be done using FileSystem trait" }, | ||
{ path = "std::path::Path::exists", reason = "File system operations should be done using FileSystem trait" }, | ||
] |
Oops, something went wrong.