~axwalk/juju-core/lp1303195-manual-ubuntuuser-bash

Viewing all changes in revision 1954.27.1.

[r=natefinch] Cross platform Replace function

Turns out that os.rename works as atomic file replacement on linux, but not on Windows. There's actually no way (as far as I can tell) to atomically replace a file with another one on windows using the go code as written. Luckily, it's not hard to wrap the Windows API in go code and use that.... so that's what this code code.

This fixes problems where we try to replace existing files with new ones, which fails on windows (notably during bootstrap).

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: