MCPcopy Create free account
hub / github.com/GCWing/BitFun / delete_file

Function delete_file

src/apps/desktop/src/api/path_target.rs:394–415  ·  view source on GitHub ↗
(app_state: &AppState, raw_path: &str)

Source from the content-addressed store, hash-verified

392}
393
394pub async fn delete_file(app_state: &AppState, raw_path: &str) -> Result<(), String> {
395 match resolve_desktop_path_target(app_state, raw_path, None).await? {
396 DesktopPathTarget::Local { resolved_path, .. } => app_state
397 .filesystem_service
398 .delete_file(&resolved_path.to_string_lossy())
399 .await
400 .map_err(|e| format!("Failed to delete file: {}", e)),
401 DesktopPathTarget::Remote {
402 requested_path,
403 entry,
404 } => {
405 let remote_fs = app_state
406 .get_remote_file_service_async()
407 .await
408 .map_err(|e| format!("Remote file service not available: {}", e))?;
409 remote_fs
410 .remove_file(&entry.connection_id, &requested_path)
411 .await
412 .map_err(|e| format!("Failed to delete remote file: {}", e))
413 }
414 }
415}
416
417pub async fn delete_directory(
418 app_state: &AppState,

Callers

nothing calls this directly

Calls 4

delete_fileMethod · 0.45
remove_fileMethod · 0.45

Tested by

no test coverage detected