# 错误：打开 /no/such/file：没有这个文件或目录

- **ID:** `go/os-file-not-exist`
- **领域:** go
- **类别:** io_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

指定的文件或目录在文件系统中不存在。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.15 | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   Check if the file exists before opening using os.Stat.
   ```
2. **** (85% 成功率)
   ```
   Use os.OpenFile with os.O_CREATE to create the file if it doesn't exist.
   ```

## 无效尝试

- **** — If the parent directory doesn't exist, creation fails. (80% 失败率)
- **** — The file path is absolute; changing the working directory won't help. (90% 失败率)
