{
  "id": "go/os-remove-file-in-use",
  "signature": "remove /tmp/locked.txt: device or resource busy",
  "signature_zh": "删除 /tmp/locked.txt: 设备或资源忙",
  "regex": "remove\\ /tmp/locked\\.txt:\\ device\\ or\\ resource\\ busy",
  "domain": "go",
  "category": "io_error",
  "subcategory": null,
  "root_cause": "Attempting to delete a file that is currently open by another process or the same process.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试删除当前被其他进程或同一进程打开的文件。",
  "versions": [
    {
      "version": "1.19",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "File remains, causing resource leak",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "RemoveAll also fails if file is busy",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "if err := file.Close(); err != nil { return err }; if err := os.Remove(path); err != nil { return err }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "Use os.Rename to a temporary name then remove",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-07-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}