RE: [PATCH] cygpath.cc

2002-05-22 Thread "Schaible, Jörg"

Hi Corinna,

>I see and that's a good idea, IMHO.  However, for now I have
>applied your patch and just tweaked the usage output slightly.

Fine. I was unhappy with it by myself also, but was not sure how to improve
it in the best way.
:)



Re: [PATCH] cygpath.cc

2002-05-22 Thread Corinna Vinschen

On Wed, May 22, 2002 at 09:29:32AM +0200, "Schaible, Jörg" wrote:
> Hi Corinna,
> 
> >AFAICS, the patch is ok.
> 
> Fine.
> 
> >Just two question:
> >
> >- The -s and -l options are only valid with the -w option.  Shouldn't
> >  either the usage reflect that or the -s and -l options imply -w
> >  automatically?  It's not *that* obvious for the user that s/he
> >  has to use `cygpath -w -l ...'.
> 
> I always had in mind that it would be great to implement the options once
> for -u, too.

I see and that's a good idea, IMHO.  However, for now I have
applied your patch and just tweaked the usage output slightly.

Thanks,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.



RE: [PATCH] cygpath.cc

2002-05-22 Thread "Schaible, Jörg"

Hi Corinna,

>AFAICS, the patch is ok.

Fine.

>Just two question:
>
>- The -s and -l options are only valid with the -w option.  Shouldn't
>  either the usage reflect that or the -s and -l options imply -w
>  automatically?  It's not *that* obvious for the user that s/he
>  has to use `cygpath -w -l ...'.

I always had in mind that it would be great to implement the options once
for -u, too.
Example:

$ cygdrive -u `cygdrive -asw \`cygdrive -u 'C:\Dokumente und
Einstellungen\All Users\.bashrc'\``
/cygdrive/c/DOKUME~1/ALLUSE~1/BASHRC~2

It would be nice to have instead:

$ cygdrive -us 'C:\Dokumente und Einstellungen\All Users\.bashrc'
/cygdrive/c/DOKUME~1/ALLUSE~1/BASHRC~2

Another example:
At least on my box W2K is converting TEMP automatically into short form if I
open a console. This is quite inconvenient in bash and I would like to have
rather the long form:

$ echo $TEMP
/cygdrive/c/DOKUME~1/joehni/LOKALE~1/Temp

Prefered call:
$ export TEMP=`cygpath -ul $TEMP`
$ echo $TEMP
/cygdrive/c/Dokumente\ und\ Einstellungen/joehni/Lokale\ Einstellungen/Temp

In any case, the normal usage of cygpath should not care about -s or -l,
since you would normally only convert a Unix path into a DOSish notation
(which is by default the long form anyway). Both options are IMHO for very
special purposes.

What bothers me more, is that you cannot convert a short path into the long
version when check_case:strict is set, since the conversion functions in the
cygwin1.dll will reject that path as non-matching. But I am not really sure,
whether this functions should look for the alternative physical name or not.
Another problem arises with Java CLASSPATHs, since their element may be also
files instead of directories, which prevents a conversion unfortunately,
too.

Regards
Jörg



Re: [PATCH] cygpath.cc

2002-05-21 Thread Corinna Vinschen

On Tue, May 21, 2002 at 09:02:00AM +0200, "Schaible, Jörg" wrote:
> Hi,
> 
> as already announced here is the next patch for cygpath.cc supporting -l
> option to convert file names to Windows long format. Unfortunately this
> works not for strict mode, since functions cygwin_conv_to_win32_path and
> cygwin_conv_to_full_win32_path will return an error for a Windows short
> path/name.

AFAICS, the patch is ok.

Just two question:

- The -s and -l options are only valid with the -w option.  Shouldn't
  either the usage reflect that or the -s and -l options imply -w
  automatically?  It's not *that* obvious for the user that s/he
  has to use `cygpath -w -l ...'.

Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.



[PATCH] cygpath.cc

2002-05-20 Thread "Schaible, Jörg"

Hi,

as already announced here is the next patch for cygpath.cc supporting -l
option to convert file names to Windows long format. Unfortunately this
works not for strict mode, since functions cygwin_conv_to_win32_path and
cygwin_conv_to_full_win32_path will return an error for a Windows short
path/name.

2002-05-20  Joerg Schaible <[EMAIL PROTECTED]>

* cygpath.cc (main): Add option l to support conversion to
Windows long file names.  Refactured code for capital options.
Support of options from file for capital options.
(dowin): New function.  Refactured from main.
(doit): Call long path conversion.
(get_long_name): New function.
(get_long_paths): New function.
(get_long_path_name_w32impl): New function.  Reimplementation
of Windows API function GetLongPathName (only 98/Me/2000/XP or 
higher).
(get_short_name): Call GetShortPathName only once.
(get_short_paths): Fix calculating buffer size.
* utils.sgml: Update cygpath section for l option.

Regards,
Jörg




cygpath.diff
Description: Binary data


utils.diff
Description: Binary data