X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_YG X-Spam-Check-By: sourceware.org From: Barry Kelly To: Pierce Morton Cc: cygwin AT cygwin DOT com Subject: Re: cygpath unable to translate the *nix path to an NTFS junction point Date: Mon, 17 Jan 2011 02:48:54 +0000 Message-ID: <1ra7j6h9scktvnlpdceejo3i3q4k4f5c3c@4ax.com> References: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="--=_mgb7j6t55jlalaap8r1vefu9ddtnlmfptj.MFSBCHJLHS" X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 ----=_mgb7j6t55jlalaap8r1vefu9ddtnlmfptj.MFSBCHJLHS Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Pierce Morton wrote: > I've recently installed cygwin using the web installer, and have found > an error in the way that cygpath translates junction point paths from > *nix to Windows paths when dealing with a junction point. The issue is that Cygwin treats reparse points as symlinks. IMO, the more normal uses of junctions in the Windows ecosystem is not very close to the usage of POSIX symlinks, so this behaviour is undesirable. For example, on my main workstation, I have an SSD primary drive for booting and critical applications, and a larger mechanical drive for bulk storage. To make this combination work well, I use junctions extensively in order to allocate subtrees of the C: drive (an SSD) on the mechanical drive. Since many Windows application installers don't give a choice of installation directory, and even when they do they frequently carve off large chunks of C: for shared files and other purposes, junctions really are the easiest way of doing it. I frequently post-process installation trees by choosing large directories to hive off to bulk storage, and even have a script to automate the procedure. Unfortunately, this extensive use doesn't work well with Cygwin treating those junctions as symlinks. Things like 'cp * ../other-dir' will break if the current directory is a junction; and 'cygstart .' will open up the directory in Explorer, except in the wrong tree. So I wrote this modification to cygwin-1.7.7-1 which adds a new option to the CYGWIN environment variable, "junctionlinks", which defaults to true (the current behaviour). By adding "nojunctionlinks" to CYGWIN, treating junctions as symlinks is disabled. -- Barry --=20 http://blog.barrkel.com/ ----=_mgb7j6t55jlalaap8r1vefu9ddtnlmfptj.MFSBCHJLHS Content-Type: application/octet-stream; name=cygwin-1.7.7-1_junctionlinks_opt.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=cygwin-1.7.7-1_junctionlinks_opt.patch ZGlmZiAtcnUgY3lnd2luLTEuNy43LTEvd2luc3VwL2N5Z3dpbi9lbnZpcm9u LmNjIGN5Z3dpbi0xLjcuNy0xX2Jqay93aW5zdXAvY3lnd2luL2Vudmlyb24u Y2MKLS0tIGN5Z3dpbi0xLjcuNy0xL3dpbnN1cC9jeWd3aW4vZW52aXJvbi5j YwkyMDEwLTA4LTE2IDE0OjU1OjA3LjAwMDAwMDAwMCArMDEwMAorKysgY3ln d2luLTEuNy43LTFfYmprL3dpbnN1cC9jeWd3aW4vZW52aXJvbi5jYwkyMDEx LTAxLTE3IDAyOjIwOjE1LjEzNjMzMTYwMCArMDAwMApAQCAtMzIsNiArMzIs NyBAQAogI2luY2x1ZGUgIm50ZGxsLmgiCiAKIGV4dGVybiBib29sIGRvc19m aWxlX3dhcm5pbmc7CitleHRlcm4gYm9vbCByZWNvZ25pemVfanVuY3Rpb25z OwogZXh0ZXJuIGJvb2wgaWdub3JlX2Nhc2Vfd2l0aF9nbG9iOwogZXh0ZXJu IGJvb2wgYWxsb3dfd2luc3ltbGlua3M7CiBib29sIHJlc2V0X2NvbSA9IGZh bHNlOwpAQCAtNTk4LDYgKzU5OSw3IEBACiAgIHsiZXhwb3J0IiwgeyZleHBv cnRfc2V0dGluZ3N9LCBqdXN0c2V0LCBOVUxMLCB7e2ZhbHNlfSwge3RydWV9 fX0sCiAgIHsiZm9ya2NodW5rIiwge2Z1bmM6IHNldF9jaHVua3NpemV9LCB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YgKCFyZWNvZ25pemVfanVuY3Rpb25zKQorICAgICAgICB7CisgICAgICAg ICAgLyogUHJldGVuZCB3ZSBkb24ndCBrbm93IHdoYXQgYSBqdW5jdGlvbiBp cywganVzdCBsaWtlIHRoZSAKKyAgICAgICAgICAgICB1bnJlY29nbml6ZSBj YXNlLiAqLworICAgICAgICAgIGZpbGVhdHRyICY9IH5GSUxFX0FUVFJJQlVU RV9SRVBBUlNFX1BPSU5UOworICAgICAgICAgIHJldHVybiAwOworICAgICAg ICB9CisgICAgICBlbHNlCisgICAgICAgIFJ0bEluaXRDb3VudGVkVW5pY29k ZVN0cmluZyAoJnN1YnN0LAogCQkgIChXQ0hBUiAqKSgoY2hhciAqKXJwLT5T eW1ib2xpY0xpbmtSZXBhcnNlQnVmZmVyLlBhdGhCdWZmZXIKIAkJCSsgcnAt PlN5bWJvbGljTGlua1JlcGFyc2VCdWZmZXIuU3Vic3RpdHV0ZU5hbWVPZmZz ZXQpLAogCQkgIHJwLT5TeW1ib2xpY0xpbmtSZXBhcnNlQnVmZmVyLlN1YnN0 aXR1dGVOYW1lTGVuZ3RoKTsKKyAgICB9CiAgIGVsc2UgaWYgKHJwLT5SZXBh cnNlVGFnID09IElPX1JFUEFSU0VfVEFHX01PVU5UX1BPSU5UKQogICAgIHsK LSAgICAgIFJ0bEluaXRDb3VudGVkVW5pY29kZVN0cmluZyAoJnN1YnN0LCAK KyAgICAgIGlmICghcmVjb2duaXplX2p1bmN0aW9ucykgCisgICAgICAgIHsK KyAgICAgICAgICAvKiBQcmV0ZW5kIHdlIGRvbid0IGtub3cgd2hhdCBhIGp1 bmN0aW9uIGlzLCBqdXN0IGxpa2UgdGhlIAorICAgICAgICAgICAgIHVucmVj b2duaXplIGNhc2UuICovCisgICAgICAgICAgZmlsZWF0dHIgJj0gfkZJTEVf QVRUUklCVVRFX1JFUEFSU0VfUE9JTlQ7CisgICAgICAgICAgcmV0dXJuIDA7 CisgICAgICAgIH0KKyAgICAgIGVsc2UKKyAg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fptj.MFSBCHJLHS Content-Type: text/plain; charset=us-ascii -- 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 ----=_mgb7j6t55jlalaap8r1vefu9ddtnlmfptj.MFSBCHJLHS--