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 Date: Sat, 5 Mar 2005 22:30:07 -0500 From: Jean-Sebastien Trottier To: Cygwin Mailing List Subject: Re: Bug diff 2.8.7: Separate dir Message-ID: <20050306033007.GB6831@gw.jsoft.lan> Mail-Followup-To: Cygwin Mailing List References: <20050306014821 DOT 3C2D721016A AT warserver DOT warande DOT net> <422A7110 DOT 84D428B AT dessent DOT net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2B/JsCI69OhZNC5r" Content-Disposition: inline In-Reply-To: <422A7110.84D428B@dessent.net> User-Agent: Mutt/1.5.6+20040907i X-IsSubscribed: yes --2B/JsCI69OhZNC5r Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 05, 2005 at 06:55:12PM -0800, Brian Dessent wrote: > Arend-Jan Westhoff wrote: >=20 > > 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! >=20 > I think this happens because diff calls stat() on both files and > recognizes that they are actually the same file without even reading > them. >=20 > > 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. >=20 > They will, if you use '/' as the path separator. >=20 > 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. >=20 > 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.=20 > And as you've seen it can lead to confusing situations. Seems obvious to me that Cygwin is doing the right thing... Let's say you have c:\windows mounted in binary mode as /winbin and also mounted as text mode as /wintxt. Cygwin treats... - /winbin/file.txt as binary - /wintxt/file.txt as text and does CRLF translation - c:\windows\file.txt as binary since it is a native path and it would obviously be futile to try and map it to a single mount point My .02$... Sebastien >=20 > 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.=20 > '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. >=20 > 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. >=20 > Brian >=20 > -- > 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/ >=20 --2B/JsCI69OhZNC5r Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFCKnk/WHtULG0eY+ERAihQAJ9hFkRKk+isENQpdmk5c5zrstayagCdGUDd kStzJUQSs/dGITEjasK1T2A= =iPzd -----END PGP SIGNATURE----- --2B/JsCI69OhZNC5r--