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:
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 '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.


The difference probably occurs because 1.7 now uses NtSetInformationFile() instead of MoveFileEx() and DeleteFile().

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]