summaryrefslogtreecommitdiff
path: root/ext/node/ops.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/ops.rs')
-rw-r--r--ext/node/ops.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/node/ops.rs b/ext/node/ops.rs
index 77d148383..3db23b5ea 100644
--- a/ext/node/ops.rs
+++ b/ext/node/ops.rs
@@ -264,8 +264,8 @@ where
{
let path = PathBuf::from(path);
ensure_read_permission::<Env::P>(state, &path)?;
- if Env::Fs::exists(&path) {
- if Env::Fs::is_file(&path) {
+ if let Ok(metadata) = Env::Fs::metadata(&path) {
+ if metadata.is_file {
return Ok(0);
} else {
return Ok(1);