On 2007/03/14 17:28, Clint M. Sand wrote: > I know this is a dumb question but make install on a kernel build does: > > rm -f /obsd > ln /bsd /obsd > cp bsd /nbsd > mv /nbsd /bsd > > But I can't see the reasoning here. Why do we copy it then move it > rather than just copying it straight to /bsd?
many of the ways in which a copy could fail will result in a broken destination file. mv uses the rename system call when source and destination are on the same filesystem; this provides a guarantee noted in rename(2).