This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: overwriting an in-use executable


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 is more like
Linux and traditional unix semantics
And very useful it is, but I was wondering why it works with 'mv' but not 'cp'?


'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 data (inode) until the exe terminates.


Christian


-- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]