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

Method file_metadata

atomic-core/src/output/filesystem/walk.rs:99–108  ·  view source on GitHub ↗

Get metadata for a file or directory.

(&self, path: &str)

Source from the content-addressed store, hash-verified

97
98 /// Get metadata for a file or directory.
99 fn file_metadata(&self, path: &str) -> Result<FileMetadata, Self::Error> {
100 let abs_path = self.resolve_path(path)?;
101 let metadata = fs::symlink_metadata(&abs_path)?;
102
103 Ok(FileMetadata {
104 permissions: get_permissions(&metadata),
105 is_dir: metadata.is_dir(),
106 is_symlink: metadata.file_type().is_symlink(),
107 })
108 }
109
110 /// Read the contents of a file into a buffer.
111 ///

Calls 3

get_permissionsFunction · 0.85
is_dirMethod · 0.80
resolve_pathMethod · 0.45