id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
1413,copyFile: atomicity docs/code mismatch,guest,igloo,"http://haskell.org/ghc/docs/latest/html/libraries/base/System-Directory.html#v%3AcopyFile says:

  copyFile old new copies the existing file from old to new. If the new file already exists, it is ''atomically replaced'' by the old file. Neither path may refer to an existing directory. The permissions of old are copied to new, if possible.

AFAIK the only way to do atomic replacement is to write to a temporary file, then rename it over the target. However, strace shows that copyFile does open(), ftruncate(), then multiple write()s; this is clearly not atomic.

Conclusion: Either the docs or the code are wrong.",bug,closed,high,6.8.1,libraries/base,6.6.1,fixed,,,Unknown/Multiple,Unknown/Multiple,,Unknown,,,,
