Inconsistence on file operation when the name already exists with exe extension

notstop notstop@live.com
Mon Jul 9 15:23:00 GMT 2012


You must be right in some points, but that is not the exact behavior of 
windows command although you pretend it to be (the powershell has a 
different behavior). In fact, I can independently operate file while 
file.exe exists:

copy file.exe file
Now there are file and file.exe

-- windows cmd.exe behaves like that:

del file: removes file only regardless of file.exe existence
del file.exe: removes file.exe only regardless of file existence

-- Cygwin behaves differently:

rm file.exe: will remove only file.exe if exists
rm file: will remove file if exists, and if not will remove file.exe


Considering this, may be be an issue when untaring a tarfile whose 
contents will match an already existing file in the directory with the 
exe extension. If both thefile and thefile.exe are packed in the tar, 
won't be an issue since thefile is alphabetically precedent to 
thefile.exe so both will be untared, but is just a mere coincidence that 
it works. Would be an issue if where the opposite.


--
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



More information about the Cygwin mailing list