Re: overwriting an in-use executable

2009-12-13 Thread Andy Koppe
2009/12/13 Christian Franke: > 'cp' does not unlink() before overwriting an existing file, it tries to > overwrite the data in place. This also fails on *nix, typically with "Text > file busy". > 'mv' only modifies the link between file name in directory and file data. > The OS can keep the old dat

Re: overwriting an in-use executable

2009-12-13 Thread Christian Franke
Andy Koppe wrote: 2009/12/13 Eric Blake: Same when trying to 'rm' an in-use executable: Works on 1.7, fails with 'Permission denied' on 1.5. Cygwin 1.7 works like Linux here. I don't know whether POSIX requires this behavior. POSIX allows both behaviors, but the cygwin 1.7 behavior

Re: overwriting an in-use executable

2009-12-13 Thread Andy Koppe
2009/12/13 Eric Blake: >> Same when trying to 'rm' an in-use executable: Works on 1.7, fails with >> 'Permission denied' on 1.5. Cygwin 1.7 works like Linux here. I don't >> know whether POSIX requires this behavior. > > POSIX allows both behaviors, but the cygwin 1.7 behavior is more like > Linux

Re: overwriting an in-use executable

2009-12-13 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Christian Franke on 12/13/2009 5:16 AM: > > Same when trying to 'rm' an in-use executable: Works on 1.7, fails with > 'Permission denied' on 1.5. Cygwin 1.7 works like Linux here. I don't > know whether POSIX requires this behavior. POSI

Re: overwriting an in-use executable

2009-12-13 Thread Christian Franke
Andy Koppe wrote: cp and mv behave differently when trying to overwrite an in-use executable: $ cp mintty.exe /bin cp: cannot create regular file `/bin/mintty.exe': Device or resource busy $ mv mintty.exe /bin [works fine] That's on 1.7. On 1.5, both cp and mv fail. Same when trying to