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

Method file_metadata

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

Get metadata for a file or directory.

(&self, path: &str)

Source from the content-addressed store, hash-verified

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

Calls 3

get_permissionsFunction · 0.85
is_dirMethod · 0.80
resolve_pathMethod · 0.45