Feature Proposals » saveFile function to be atomic -- writing completely or not writing at all

Summary

Current State: Developer: Reason: Date: Concerns By: Bug Tracking: Proposed For:
AcceptedProposal HideyoImazu AcceptedByReleaseMeeting 2016年11月10日 TWikibug:Item7760 KampalaRelease

Edit Form

CurrentState:
ReasonForDecision:
DateOfCommitment: Format: YYYY-MM-DD
ProposedFor:

Motivation

TWiki::Store::RcsFile::saveFile() writes to a specified file naively. So a file may have a partially written content if saveFile() is interrupted after it starts writing but before it completes writing. saveFile() should be atomic -- writing completely or not writing at all.

Description and Documentation

Instead of writing naively, writing to a temporary file and then renaming to the specified name makes saveFile() atomic. More specifically, it will writie to a file name having ".PROCESS_ID" appended, and then it will rename to the specified file name.

Examples

Impact

Implementation

-- Contributors: Hideyo Imazu - 2016年11月10日

Discussion

Yes, indeed, good proposal.

-- Peter Thoeny - 2016年11月17日

Edit | Attach | (削除) Watch (削除ここまで) | Print version | History : r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2016年11月21日 - HideyoImazu
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

AltStyle によって変換されたページ (->オリジナル) /