Arc Forumnew | comments | leaders | submitlogin
1 point by zck 4648 days ago | link | parent

What don't you like about the way Arc handles temporary files? Is that you can't have another file named that? Arc could use `(file-gensym)` instead, if that was a thing.


2 points by Pauan 4642 days ago | link

To put it simply, I think Arc should use Racket's support for temporary files:

http://docs.racket-lang.org/reference/Filesystem.html?q=temp...

-----

1 point by akkartik 4641 days ago | link

Ok, done: http://github.com/nex3/arc/commit/df9fd21eeb

Thanks for the tip! I had no idea there could be a better way. Now I find that my use of $RANDOM in shell scripts should be replaced with calls to mktemp as well.

-----

1 point by akkartik 4647 days ago | link

Ah, good point. Here's a quick-and-dirty fix:

http://github.com/nex3/arc/commit/c70a51a4d5

Now tofile does the 'write to tmp file and move' dance. writefile is implemented in terms of tofile. Finally, the tmp file is more randomly chosen, so it should be thread-safe.

-----