# error: rename /old/path /new/path: invalid cross-device link

- **ID:** `go/os-rename-file-cross-device`
- **Domain:** go
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Attempting to rename a file across different file systems or mount points, which is not supported by os.Rename.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.20 | active | — | — |
| 1.21 | active | — | — |

## Workarounds

1. **Implement copy-then-delete strategy with error handling** (90% success)
   ```
   src, _ := os.Open(oldPath)
dst, _ := os.Create(newPath)
io.Copy(dst, src)
src.Close()
dst.Close()
os.Remove(oldPath)
   ```

## Dead Ends

- **Using os.Rename with fallback to copy+delete only on error** — Does not handle atomicity; may leave partial files. (50% fail)
