// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. use std::cell::RefCell; use std::path::Path; use std::path::PathBuf; use std::rc::Rc; use deno_core::error::AnyError; use deno_core::op2; use deno_core::OpState; use deno_fs::FileSystemRc; use crate::NodePermissions; #[op2(fast)] pub fn op_node_fs_exists_sync
(
state: &mut OpState,
#[string] path: String,
) -> Result ()
.check_read_with_api_name(&path, Some("node:fs.existsSync()"))?;
let fs = state.borrow:: (
state: &mut OpState,
#[string] path: &str,
#[string] new_path: &str,
) -> Result<(), AnyError>
where
P: NodePermissions + 'static,
{
let path = Path::new(path);
let new_path = Path::new(new_path);
state
.borrow_mut:: ()
.check_read_with_api_name(path, Some("node:fs.cpSync"))?;
state
.borrow_mut:: ()
.check_write_with_api_name(new_path, Some("node:fs.cpSync"))?;
let fs = state.borrow:: (
state: Rc ()
.check_read_with_api_name(&path, Some("node:fs.cpSync"))?;
state
.borrow_mut:: ()
.check_write_with_api_name(&new_path, Some("node:fs.cpSync"))?;
state.borrow::