summaryrefslogtreecommitdiff
path: root/cli/standalone/file_system.rs
diff options
context:
space:
mode:
authorNathan Whitaker <17734409+nathanwhit@users.noreply.github.com>2024-07-05 11:32:51 -0700
committerGitHub <noreply@github.com>2024-07-05 18:32:51 +0000
commitd4d3a3c54f5e26dec0cc79e273dc488f8a47f2b3 (patch)
treee6ff88b550211257ea7a7997e221d10fdf22e242 /cli/standalone/file_system.rs
parent28d2ff7bdc023a3b7aff47503aa03a8dd65fe87f (diff)
fix(node): Implement `fs.lchown` (and `process.getegid`) (#24418)
Closes https://github.com/denoland/deno/issues/21260. Part of https://github.com/denoland/deno/issues/18218. Implements `node:fs.lchown`, and enables the node_compat test for it. The test uses `process.getegid`, which we didn't have implemented, so I went ahead and implemented that as well to get the test working.
Diffstat (limited to 'cli/standalone/file_system.rs')
-rw-r--r--cli/standalone/file_system.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/cli/standalone/file_system.rs b/cli/standalone/file_system.rs
index 13da0a729..536b17f27 100644
--- a/cli/standalone/file_system.rs
+++ b/cli/standalone/file_system.rs
@@ -145,6 +145,26 @@ impl FileSystem for DenoCompileFileSystem {
RealFs.chown_async(path, uid, gid).await
}
+ fn lchown_sync(
+ &self,
+ path: &Path,
+ uid: Option<u32>,
+ gid: Option<u32>,
+ ) -> FsResult<()> {
+ self.error_if_in_vfs(path)?;
+ RealFs.lchown_sync(path, uid, gid)
+ }
+
+ async fn lchown_async(
+ &self,
+ path: PathBuf,
+ uid: Option<u32>,
+ gid: Option<u32>,
+ ) -> FsResult<()> {
+ self.error_if_in_vfs(&path)?;
+ RealFs.lchown_async(path, uid, gid).await
+ }
+
fn remove_sync(&self, path: &Path, recursive: bool) -> FsResult<()> {
self.error_if_in_vfs(path)?;
RealFs.remove_sync(path, recursive)