[racket-dev] atomic file update by write & rename... not!

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Jan 13 16:40:48 EST 2011

At Thu, 13 Jan 2011 16:30:08 -0500, Eli Barzilay wrote:
> 15 minutes ago, Matthew Flatt wrote:
> > Is there anything else in the main distribution that is uses
> > `rename-file-or-directory' for atomic update?
> Is the handin-server's use kosher?  There are three uses of it, and
> the only one that looks suspicious is the last one, where "ATTEMPT" is
> renamed to "SUCCESS-0".

Those are directories, and you can't move to an existing directory name
on any platform, right?

I think the handin server probably depends on non-concurrent handins
for a given account, though, since it shuffles many files and
directories around. Probably it should use some sort of lock to enforce

Posted on the dev mailing list.