[
https://issues.apache.org/jira/browse/IO-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17800170#comment-17800170
]
Elliotte Rusty Harold commented on IO-412:
------------------------------------------
I don't think IO-316 is the same. IO-316 is about maintaining backup copies of
file, like VMS used to do, not about all or nothing writes. This proposal does
not maintain any backup copies.
The idea here does strike me as useful. I don't know how to reliably implement
it across platforms, but maybe somebody can figure it out by starting with
other FileUtils methods to move files.
> AllOrNothingOutputStream
> ------------------------
>
> Key: IO-412
> URL: https://issues.apache.org/jira/browse/IO-412
> Project: Commons IO
> Issue Type: New Feature
> Components: Streams/Writers
> Reporter: David Mollitor
> Priority: Minor
> Attachments: AllOrNothingFileOutputStream.java,
> PartingFileOutputStream.java, PartingFileOutputStreamTest.java
>
>
> Feel free to include this new FileOutputstream. No unit tests yet. Looking
> for feedback at this point.
> {code}
> /**
> * This is a wrapper around a FileOutputStream. It enables a stream to be
> * written to a hidden file in a directory and only then renamed to the final
> * destination if no exceptions occur. This implementation marks the file as
> * hidden by pre-appending the file name with a period. If any exceptions
> occur
> * during writing, the hidden file will be deleted once close() is called.
> This
> * class takes advantage of {@link File#renameTo(File)}; therefore, many
> aspects
> * of the behavior of this class are inherently platform-dependent: The rename
> * operation might not be able to move a file from one filesystem to another,
> it
> * might not be atomic, and it might not succeed if a file with the
> destination
> * abstract pathname already exists. This class is most useful when the rename
> * operation is atomic. It is designed for the case when one process is
> writing
> * to a directory and another process is polling the directory for files to
> * read.
> */
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)