This is the mail archive of the cygwin 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]
Other format: [Raw text]

Design issue with new MS-DOS style path warning?


Hello folks,

I am aware it is possible to disable the "MS-DOS style path detected"
warning with the 'nodosfilewarning' option.

But this message raises the question of, "What is the Cygwin ideal?"
That is, how to avoid the warning in a "clean" way without resorting to
the 'nodosfilewarning' option?

There is a situation in which it is not conceptually "clean" to avoid
the warning: at the interface between the host OS and Cygwin tools.

Say, for example, you create a Windows batch file containing the line:

  touch C:\foo.txt

You will receive the warning "MS-DOS style path detected."  How do you
avoid the warning without resorting to 'nodosfilewarning'?

1. Use cygpath to convert the path first.  This solution is not ideal,
because it forces the caller of 'touch' to know that it is a Cygwin
utility and not a native one.  It is also not ideal because in some use
cases it is very impractical to run cygpath over a path before passing
it on to a command.

2. Use some alternative to cygpath, i.e., manual transformation of the
path from DOS style to POSIX style.  This suffers from the same issues
as item #1, with the added issue that it also forces the caller to be
aware of Cygwin internals (i.e., how to map X: to /cygdrive/X/).

3. Put your commands in a shell script and run them from there.  Not
ideal because in a sense it forces you, again, to know the difference
between Cygwin and native utilities.  Even if you're okay with that,
you'll get bitten running the script -- the invocation "bash
C:\script.sh" suffers the same issue!

When starting Cygwin executables from Windows, it should be considered
reasonable -- even sensible -- to use Windows native paths.

Perhaps there should be no warning generated for command-line arguments
when the executable is launched from Windows.  Or perhaps paths should
be converted from Windows to POSIX at that time (similar to the way the
PATH environment variable is handled).

Or perhaps I'm completely missing something fundamental and you're about
to set me straight.  :-)

Thanks for your time.

Best wishes,

Chuck


--
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


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