MCPcopy Create free account
hub / github.com/CodeBendKit/codeseek / get_saved_files_info

Method get_saved_files_info

rust-core/src/storage/persistence.rs:204–224  ·  view source on GitHub ↗

获取已保存的文件信息

(&self, project_id: &str)

Source from the content-addressed store, hash-verified

202
203 /// 获取已保存的文件信息
204 pub fn get_saved_files_info(&self, project_id: &str) -> io::Result<Vec<String>> {
205 let project_dir = self.project_dir(project_id);
206 let mut files = Vec::new();
207
208 if !project_dir.exists() {
209 return Ok(files);
210 }
211
212 for entry in fs::read_dir(&project_dir)? {
213 let entry = entry?;
214 if entry.file_type()?.is_file() {
215 if let Some(name) = entry.file_name().to_str() {
216 let metadata = entry.metadata()?;
217 let size = metadata.len();
218 files.push(format!("{} ({} bytes)", name, size));
219 }
220 }
221 }
222
223 Ok(files)
224 }
225
226 // ---- Projects registry (for parsed projects) ----
227

Callers

nothing calls this directly

Calls 1

project_dirMethod · 0.80

Tested by

no test coverage detected