-
Notifications
You must be signed in to change notification settings - Fork 0
fix: write qdocco outputs atomically #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # RFC 0101:qdocco 原子输出 | ||
|
|
||
| - 状态:已采纳 | ||
| - 依赖:RFC 0083、RFC 0094 | ||
|
|
||
| `qdocco` 生成 HTML 或 Markdown 时,先在目标文件同一目录建立带进程号的临时文件,完整写入并同步后,再以重命名替换目标文件。Unix 上替换后还同步父目录,故目录项在断电后可恢复;Windows 不支持同名目标的原子 `rename`,实现会在临时文件已同步后删除旧目标再重命名,因此该平台的替换不是原子的。写入或替换失败时清理临时文件,并保留原有目标产物(Windows 删除旧目标后的重命名失败除外);目标路径仍不得与源码相同(RFC 0083)。 | ||
|
|
||
| 该契约避免磁盘错误、进程中断或宿主终止时留下半份文档。临时文件名以 `OsString` 保留目标文件名,故 Unix 非 UTF-8 路径不会退化为共享的默认临时名。临时文件使用独占创建;同一目录中已有同名临时文件时本次生成失败而不覆盖它。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.