Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <422A7110.84D428B@dessent.net> Date: Sat, 05 Mar 2005 18:55:12 -0800 From: Brian Dessent Organization: My own little world... MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Bug diff 2.8.7: Separate dir References: <20050306014821 DOT 3C2D721016A AT warserver DOT warande DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Arend-Jan Westhoff wrote: > It also seems inconsequent if what you say is truely correct and what is > intended that when I use my file 'a' from my original example and do the > following: > copy a b > that then: > diff ./a .\b > says that the files are completely different, whereas: > diff ./a .\a > says they are completely equal, while files a and b are character for > character identical! I think this happens because diff calls stat() on both files and recognizes that they are actually the same file without even reading them. > Therefor in my opinion according to the User's Guide all files > on my d: drive should have been opened by diff in text mode, > which as we saw is currently not the case. They will, if you use '/' as the path separator. The fact is that Cygwin is trying to emulate/provide a POSIX type environment to the apps that are running under it, and this means the path separator is the '/', as on just about any unix-like system. If you want Cygwin to perform newline-translation you should use POSIX paths. When you specify a filename like "c:\windows\file.txt" or "a\b" you are using Windows style paths and not POSIX style ones, and Cygwin just passes them on straight to the underlying Windows system calls. I don't know enough about Cygwin history or internals to say why this is the case. Someone who knows more about it would have to explain it. And as you've seen it can lead to confusing situations. That said, from what I can tell the ability for *some* Cygwin apps to accept '\'-style paths in *some* situations is more or less luck. 'diff' aside, there are probably many other ported Cygwin apps that will choke in strange ways if you try to feed them a path with '\' because they are all coded to recognise '/' as a path separator. The cygpath utility is provided for translating paths, so that if you have a windows program calling a cygwin one (or vice versa) you can convert the arguments between the two. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/