MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / mark_non_writable

Method mark_non_writable

atomic-core/src/output/memory.rs:358–360  ·  view source on GitHub ↗

Mark a path as non-writable. Files marked as non-writable will return `false` from `is_writable()`. # Example ```rust use atomic_core::output::{Memory, WorkingCopy}; let wc = Memory::new(); wc.add_file("readonly.txt", b"data"); wc.mark_non_writable("readonly.txt"); assert!(!wc.is_writable("readonly.txt").unwrap()); ```

(&self, path: &str)

Source from the content-addressed store, hash-verified

356 /// assert!(!wc.is_writable("readonly.txt").unwrap());
357 /// ```
358 pub fn mark_non_writable(&self, path: &str) {
359 self.non_writable.borrow_mut().push(path.to_string());
360 }
361
362 /// Get the raw contents of a file.
363 ///

Callers 1

test_is_writable_markedFunction · 0.80

Calls 1

pushMethod · 0.45

Tested by 1

test_is_writable_markedFunction · 0.64