This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cygnus bugs


In wstd.mail.gnu-win32, you wrote:

> Tim Newsham <newsham@aloha.net> writes:
> 
> >- cygwin does not properly transform command line path names across
> >  mount points.  If I am on drive "D:" and type "vi /tmp/foo",
> >  I end up editing "D:\tmp\foo" and not "C:\tmp\foo" even though
> >  "/tmp" is on "C:".  (vi is not compiled with cygwin).
> >  Cygwin should transform the path to "C:\tmp\foo" for the benefit
> >  of non-cygwin applications.
> 
> How can cygwin know which arguments are pathnames and which are
> just ordinary strings that should not be transformed in this manner?

Cygwin can know because the strings that are pathnames are passed to
open(), at which point cygwin looks in the mount table to find what
drive-and-directory the pathname actually refers to.  For example,
given this mount table:

% mount
Device           Directory           Type        Flags
\temp            /tmp                native      no-mixed,text=binary
c:               /                   native      no-mixed,text=binary
...

Then the pathname "/tmp" refers to c:\temp regardless of my current
drive.  Since vi uses open() to access the file, then the command "vi
/tmp/foo" must open c:\temp\foo regardless of which drive is my
currect drive.
--
Francis Litterio                           PGP Key Fingerprint:
franl@world.std.omit-this.com              02 37 DF 6C 66 43 CD 2C
http://world.std.omit-this.com/~franl/     10 C8 B5 8B 57 34 F3 21

"They that can give up essential liberty to obtain a little temporary 
 safety deserve neither liberty nor safety." -- Ben Franklin, ~1784
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]