Ugh, top-posting... Reformatted. On Sat, 7 Jul 2007, Liping Zeng wrote:
> -----Original Message----- > From: Igor Peshansky [mailto:[EMAIL PROTECTED] > Sent: 2007Äê7ÔÂ7ÈÕ 10:39 > To: Liping Zeng > Cc: [EMAIL PROTECTED] As Larry said, <http://cygwin.com/acronyms/#PCYMTNQREAIYR>. 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 <http://cygwin.com/problems.html>), 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/ |\ _,,,---,,_ [EMAIL PROTECTED] | [EMAIL PROTECTED] 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
-- 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/