X-Spam-Check-By: sourceware.org Date: Sat, 7 Jul 2007 13:52:48 -0400 (EDT) From: Igor Peshansky Reply-To: cygwin AT cygwin DOT com To: Liping Zeng cc: cygwin AT cygwin DOT com Subject: RE: Problem: Why the file in the mount (as system) directory can't be found? In-Reply-To: <468fb41d.1abd600a.727d.35fd@mx.google.com> Message-ID: References: <468fb41d DOT 1abd600a DOT 727d DOT 35fd AT mx DOT google DOT com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-579758561-1183830148=:7471" Content-ID: Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 ---559023410-579758561-1183830148=:7471 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-1 Content-Transfer-Encoding: 8BIT Content-ID: Ugh, top-posting... Reformatted. On Sat, 7 Jul 2007, Liping Zeng wrote: > -----Original Message----- > From: Igor Peshansky [mailto:pechtcha AT XX DOT XXX DOT XXX] > Sent: 2007Äê7ÔÂ7ÈÕ 10:39 > To: Liping Zeng > Cc: cygwin AT XXXXXX DOT XXX As Larry said, . Thanks. > Subject: Re: Problem: Why the file in the mount (as system) directory can't be found? > > > On Sat, 7 Jul 2007, Liping Zeng wrote: > > > > > I mount D:\tornado to /tornado with following: > > > $ mount -s "D:\tornado" /tornado > > > When I exectue command in /: > > > $ wtxtcl /tornado/host/src/hutils/muntch.tcl with following result > > > couldn't read file "host/src/hutils/munch.tcl": no such file or directory > > > but after I change my work directory to /tornao, and do it again, it work > > > well. > > > I don't know why, can anyone help me? > > > > Because most likely wtxtcl is not a Cygwin program, and thus does not > > understand Cygwin mounts (or Cygwin POSIX paths, for that matter). > > Igor > > Wtxtcl is not a Cygwin program, but as what I do, the environment are same > for both executions. Sigh. I debated whether to include the explanation below in the original reply, but figured it'd be pretty obvious once you understood how Cygwin interacts with Windows. Anyway, here we go. > The diffrence is the work directory. Exactly. More precisely, the difference is the working *drive* as Windows sees it. > In /: > $ wtxtcl /tornado/host/src/hutils/muntch.tcl > > couldn't read file "host/src/hutils/munch.tcl": no such file or directory Absent information about your system (which you should have provided according to ), I can only guess that your root is on the C: drive (probably the default "C:\cygwin"). So, given that mounts are ignored and wtxtcl does not understand Cygwin's POSIX paths, the path you gave it will be interpreted as \tornado\host\src\hutils\muntch.tcl (note the absense of the drive letter). This will make Windows look on the *current* drive, which, for the root directory, is C: (and, of course, does not have a file at this path). > In /tornado > $ wtxtcl /tornado/host/src/hutils/muntch.tcl > (OK) Since /tornado mounts D:\tornado, when you cd to that directory, the current drive is D:. So again, the path is interpreted as \tornado\host\src\hutils\muntch.tcl, but that file *does* exist on the D: drive. So it just *happens* to work (as Larry termed it, serendipity). To confirm this, remount D:\tornado as /mytornado, and give the path as /mytornado/host/src/hutils/muntch.tcl. You'll see that the file will not be found no matter what the current directory is (because Windows will look for \mytornado\host\src\hutils\muntch.tcl, which does not exist on any drive). The solution is to use $(cygpath -am /tornado/host/src/hutils/muntch.tcl), as Larry already indicated, which will create an absolute path, including the drive letter, that will be understood by all Windows programs. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Belief can be manipulated. Only knowledge is dangerous. -- Frank Herbert ---559023410-579758561-1183830148=:7471 Content-Type: text/plain; charset=us-ascii -- 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/ ---559023410-579758561-1183830148=:7471--