Skip to content

Commit 4a86a85

Browse files
committed
Bugfix: Fix cross-volume copy with SmbVolume
- `is_local_volume()` in `volume_strategy.rs` incorrectly classified `SmbVolume` as local (its root `/Volumes/naspi` passed the path-prefix check). This caused Local→SMB copies to look for the source file on the local disk instead of using the volume copy path. - Now uses `volume.local_path().is_some()` which is the correct semantic check. `SmbVolume` returns `None` (ops go through smb2), so it correctly takes the volume-aware copy path.
1 parent 2df24ac commit 4a86a85

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

apps/desktop/src-tauri/src/file_system/write_operations/volume_strategy.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ use uuid::Uuid;
1515
use super::state::WriteOperationState;
1616
use crate::file_system::volume::{Volume, VolumeError};
1717

18-
/// Checks if a volume is a real local filesystem (not MTP or other virtual volumes).
18+
/// Checks if a volume is a real local filesystem (not MTP, SMB, or other virtual volumes).
19+
///
20+
/// Uses `local_path()` which returns `Some` only for volumes where `std::fs` operations
21+
/// work directly on the volume's paths. `SmbVolume` returns `None` (ops go through smb2),
22+
/// `MtpVolume` returns `None` (ops go through USB), `LocalPosixVolume` returns `Some`.
1923
pub(super) fn is_local_volume(volume: &dyn Volume) -> bool {
20-
let root = volume.root();
21-
// Local volumes start with "/" but NOT "/mtp-volume/"
22-
root.starts_with("/") && !root.starts_with("/mtp-volume/")
24+
volume.local_path().is_some()
2325
}
2426

2527
/// Copies a single path from source volume to destination volume.

0 commit comments

Comments
 (0)