Re: Atomicity of file-copying/moving

2017-05-17 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 20:02:44 UTC, Per Nordlöw wrote: The standard way is to copy the source to a temporary file on the same file system as the target file followed by hardlinking Correction: should be renaming. Here's an implementation in Python (3): https://github.com/nordlow/conta

Re: Atomicity of file-copying/moving

2017-05-17 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, May 17, 2017 at 07:56:52PM +, Per Nordlöw via Digitalmars-d-learn wrote: > On Tuesday, 16 May 2017 at 10:57:08 UTC, FreeSlave wrote: > > > > Not sure about renaming but copying is not atomic on Posix because > > it does not handle interruption by signal. I opened issue about that > >

Re: Atomicity of file-copying/moving

2017-05-17 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 17 May 2017 at 19:56:52 UTC, Per Nordlöw wrote: On Tuesday, 16 May 2017 at 10:57:08 UTC, FreeSlave wrote: Not sure about renaming but copying is not atomic on Posix because it does not handle interruption by signal. I opened issue about that https://issues.dlang.org/show_bug.cgi

Re: Atomicity of file-copying/moving

2017-05-17 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 16 May 2017 at 10:57:08 UTC, FreeSlave wrote: Not sure about renaming but copying is not atomic on Posix because it does not handle interruption by signal. I opened issue about that https://issues.dlang.org/show_bug.cgi?id=17296 The standard way is to copy the source to a tempora

Re: Atomicity of file-copying/moving

2017-05-17 Thread Jerry via Digitalmars-d-learn
On Tuesday, 16 May 2017 at 08:32:56 UTC, Nordlöw wrote: What's the status of atomicity of file-copying and -moving (renaming) using std.file on different platforms? Niall has a good talk about this on youtube: https://www.youtube.com/watch?v=uhRWMGBjlO8

Re: Atomicity of file-copying/moving

2017-05-17 Thread Andrew Godfrey via Digitalmars-d-learn
On Tuesday, 16 May 2017 at 08:32:56 UTC, Nordlöw wrote: What's the status of atomicity of file-copying and -moving (renaming) using std.file on different platforms? For renaming that's a good question, but for copying, no-one should make atomicity guarantees. It's inherently non-atomic, and i

Re: Atomicity of file-copying/moving

2017-05-16 Thread FreeSlave via Digitalmars-d-learn
On Tuesday, 16 May 2017 at 08:32:56 UTC, Nordlöw wrote: What's the status of atomicity of file-copying and -moving (renaming) using std.file on different platforms? Not sure about renaming but copying is not atomic on Posix because it does not handle interruption by signal. I opened issue abo

Atomicity of file-copying/moving

2017-05-16 Thread Nordlöw via Digitalmars-d-learn
What's the status of atomicity of file-copying and -moving (renaming) using std.file on different platforms?