# remove /tmp/locked.txt: device or resource busy

- **ID:** `go/os-remove-file-in-use`
- **Domain:** go
- **Category:** io_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Attempting to delete a file that is currently open by another process or the same process.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.19 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   if err := file.Close(); err != nil { return err }; if err := os.Remove(path); err != nil { return err }
   ```
2. **** (80% success)
   ```
   Use os.Rename to a temporary name then remove
   ```

## Dead Ends

- **** — File remains, causing resource leak (70% fail)
- **** — RemoveAll also fails if file is busy (90% fail)
