delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/07/13/09:11:41

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <B3953869CBF8D211A1E50004AC4C1B5402F41F@ULTIMATE2>
From: "Lincoln, W. Terry" <terryl AT ultimatetechnology DOT com>
To: "'Dan St.Andre''" <saint AT savantage DOT com>, cygwin AT sourceware DOT cygnus DOT com
Subject: RE: B20: cygpath doesn't handle 8.3 tilde names
Date: Tue, 13 Jul 1999 09:04:46 -0400
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)

------_=_NextPart_001_01BECD30.494F2340
Content-Type: text/plain;
	charset="iso-8859-1"

> -----Original Message-----
> From: Dan St.Andre' [mailto:saint AT savantage DOT com]
> Sent: Monday, July 12, 1999 5:47 PM
> To: cygwin AT sourceware DOT cygnus DOT com
> Subject: B20: cygpath doesn't handle 8.3 tilde names
> 
> 
> SITUATION:
>     Given a 16-bit DOS command line utility that expects 8.3 format names
and
> paths,
> the following command might fail giving error messages:
> 
>         bash $  myProg  `cygpath -w ../folder/file`  target
>         myProg: Error C101: Unable to complete operation! Please check
source/destination files
>         and disks.
> 
> ANALYSIS:
>     Upon inspection, "cygpath -w ../folder/file" resulted in a detailed
path where certain
> folder names were longer than eight characters.  Also, myProg was
discovered to be
> a win16 application that required 8.3 format folder and file names.
> 
>     In the 8.3 world, no folder name along the path may be longer than
eight(8) characters.
> In addition, file names have a similar eight character limit and the
extension [part to the
> right of the period] must be three(3) or fewer characters.  Windows makes
magic names of the
> form  "mumble~N" where mumble is the left hand six(6) characters of long
names. There are also
> length restrictions on the total length of the path+filename+extension.
[Sorry, I don't
> remember them.]
> 
> DISCUSSION:
>     I propose adding a "-8" option that deals with 
> tilde-names.  Everywhere that windoze
> deals with long names, tilde-names are supposed to work.  If 
> you changed the existing
> "-w" to output tilde-names, both short name and long name 
> windoze programs would be happy.
> I admit, that it would be regrettable to discard longname output.

This would not work for programs that recreate the file as output and/or
rename the original as a .bak file because the long name would be
permanently lost and that would break other program(s) in which the original
name is hardcoded into a batch, script or link.
 
>     Any implementation would need to grab a strings that are 
> right of a slash '/'.  If that string is longer
> that eight characters, then make it a tilde-name.  Iterate 
> until the last long string has been processed.
> 
> RECOMMENDATION:
> 1.  Cheap:  Add an option like "-8" (preferred) or "-d" to 
> request 8.3 format names
> 
>         bash $  cygpath -8 /usr/local/mumble-very-long-name.dat
>         C:\usr\local\mumble~1.dat
> 
> 2.  Nice to have:  Add some way that we get either longnames 
> or 8.3 names.
> This might be output from either 'test' or 'file' or 'type' 
> that could instruct
> cygpath how to behave
> based on the needs of the command verb EXE file.  I could 
> also see this as some
> sort of
> the 'exec16' behavior.

I would suggest you create a wrapper script to call your 16-bit program that
looks similar to this:

@echo off
rem myWrapper.cmd
myProg %~sf1 %~sf2

then just call it like this:

bash $  myWrapper  `cygpath -w ../folder/file`  target

The format of the above arguments in the myWrapper.cmd causes CMD.EXE to
substitute the 8.3 full path name of the <N>th arg in place of the %~sf<N>
sequence.

> 
>         bash $ #=== do we have a 16-bit dos program?
>         bash $ if  [ -8 `which myprog` ] ; then
>         more>     myprog  `cygpath -8 
> /usr/local/mumble-very-long-name.dat`
> target
>         more> else
>         more>     myprog  `cygpath -w 
> /usr/local/mumble-very-long-name.dat`
> target
>         more>  fi
> --or--
>         bash $  exec16  myProg  `cygpath -w ../folder/file`  target
> 
> Cordially,
>     Dan St.Andre'
>     The GRILLON Group
>     mailto:grillon AT mindspring DOT com
> --
> ==============================================================
> The Tenth Amendment ... its not only a good idea, its the law!
>
http://www.law.cornell.edu/constitution/constitution.billofrights.html#amend
mentx

==============================================================

Go in His love!

W. Terry Lincoln - Senior Engineer       \     \   _   /
Ultimate Technology Corporation           \     \ |J| /
a Tridex Company (NASDAQ:trdx)             \     _|E|_
ICQ# 39362285                               \   |_ S _|
<mailto:WTerryLincoln AT engineer DOT com>          \    |U|
<http://www.AngelFire.com/ny/TerryLincoln>    \ / |S| \
<http://www.geocities.com/Eureka/Concourse/7326>  | |
================================================ ~~~~~
Opinions expressed do not represent the management of UTC.

------_=_NextPart_001_01BECD30.494F2340
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2448.0">
<TITLE>RE: B20: cygpath doesn't handle 8.3 tilde names</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=3D2>&gt; From: Dan St.Andre' [<A =
HREF=3D"mailto:saint AT savantage DOT com">mailto:saint AT savantage DOT com</A>]</FON=
T>
<BR><FONT SIZE=3D2>&gt; Sent: Monday, July 12, 1999 5:47 PM</FONT>
<BR><FONT SIZE=3D2>&gt; To: cygwin AT sourceware DOT cygnus DOT com</FONT>
<BR><FONT SIZE=3D2>&gt; Subject: B20: cygpath doesn't handle 8.3 tilde =
names</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; SITUATION:</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Given a 16-bit DOS =
command line utility that expects 8.3 format names and</FONT>
<BR><FONT SIZE=3D2>&gt; paths,</FONT>
<BR><FONT SIZE=3D2>&gt; the following command might fail giving error =
messages:</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
bash $&nbsp; myProg&nbsp; `cygpath -w ../folder/file`&nbsp; =
target</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
myProg: Error C101: Unable to complete operation! Please check =
source/destination files</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
and disks.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; ANALYSIS:</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Upon inspection, =
&quot;cygpath -w ../folder/file&quot; resulted in a detailed path where =
certain</FONT>
<BR><FONT SIZE=3D2>&gt; folder names were longer than eight =
characters.&nbsp; Also, myProg was discovered to be</FONT>
<BR><FONT SIZE=3D2>&gt; a win16 application that required 8.3 format =
folder and file names.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; In the 8.3 world, no =
folder name along the path may be longer than eight(8) =
characters.</FONT>
<BR><FONT SIZE=3D2>&gt; In addition, file names have a similar eight =
character limit and the extension [part to the</FONT>
<BR><FONT SIZE=3D2>&gt; right of the period] must be three(3) or fewer =
characters.&nbsp; Windows makes magic names of the</FONT>
<BR><FONT SIZE=3D2>&gt; form&nbsp; &quot;mumble~N&quot; where mumble is =
the left hand six(6) characters of long names. There are also</FONT>
<BR><FONT SIZE=3D2>&gt; length restrictions on the total length of the =
path+filename+extension.&nbsp; [Sorry, I don't</FONT>
<BR><FONT SIZE=3D2>&gt; remember them.]</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; DISCUSSION:</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I propose adding a =
&quot;-8&quot; option that deals with </FONT>
<BR><FONT SIZE=3D2>&gt; tilde-names.&nbsp; Everywhere that =
windoze</FONT>
<BR><FONT SIZE=3D2>&gt; deals with long names, tilde-names are supposed =
to work.&nbsp; If </FONT>
<BR><FONT SIZE=3D2>&gt; you changed the existing</FONT>
<BR><FONT SIZE=3D2>&gt; &quot;-w&quot; to output tilde-names, both =
short name and long name </FONT>
<BR><FONT SIZE=3D2>&gt; windoze programs would be happy.</FONT>
<BR><FONT SIZE=3D2>&gt; I admit, that it would be regrettable to =
discard longname output.</FONT>
</P>

<P><FONT SIZE=3D2>This would not work for programs that recreate the =
file as output and/or rename the original as a .bak file because the =
long name would be permanently lost and that would break other =
program(s) in which the original name is hardcoded into a batch, script =
or link.</FONT></P>

<P><FONT SIZE=3D2>&nbsp;</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Any implementation =
would need to grab a strings that are </FONT>
<BR><FONT SIZE=3D2>&gt; right of a slash '/'.&nbsp; If that string is =
longer</FONT>
<BR><FONT SIZE=3D2>&gt; that eight characters, then make it a =
tilde-name.&nbsp; Iterate </FONT>
<BR><FONT SIZE=3D2>&gt; until the last long string has been =
processed.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; RECOMMENDATION:</FONT>
<BR><FONT SIZE=3D2>&gt; 1.&nbsp; Cheap:&nbsp; Add an option like =
&quot;-8&quot; (preferred) or &quot;-d&quot; to </FONT>
<BR><FONT SIZE=3D2>&gt; request 8.3 format names</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
bash $&nbsp; cygpath -8 /usr/local/mumble-very-long-name.dat</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
C:\usr\local\mumble~1.dat</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; 2.&nbsp; Nice to have:&nbsp; Add some way that =
we get either longnames </FONT>
<BR><FONT SIZE=3D2>&gt; or 8.3 names.</FONT>
<BR><FONT SIZE=3D2>&gt; This might be output from either 'test' or =
'file' or 'type' </FONT>
<BR><FONT SIZE=3D2>&gt; that could instruct</FONT>
<BR><FONT SIZE=3D2>&gt; cygpath how to behave</FONT>
<BR><FONT SIZE=3D2>&gt; based on the needs of the command verb EXE =
file.&nbsp; I could </FONT>
<BR><FONT SIZE=3D2>&gt; also see this as some</FONT>
<BR><FONT SIZE=3D2>&gt; sort of</FONT>
<BR><FONT SIZE=3D2>&gt; the 'exec16' behavior.</FONT>
</P>

<P><FONT SIZE=3D2>I would suggest you create a wrapper script to call =
your 16-bit program that looks similar to this:</FONT>
</P>

<P><FONT SIZE=3D2>@echo off</FONT>
<BR><FONT SIZE=3D2>rem myWrapper.cmd</FONT>
<BR><FONT SIZE=3D2>myProg %~sf1 %~sf2</FONT>
</P>

<P><FONT SIZE=3D2>then just call it like this:</FONT>
</P>

<P><FONT SIZE=3D2>bash $&nbsp; myWrapper&nbsp; `cygpath -w =
../folder/file`&nbsp; target</FONT>
</P>

<P><FONT SIZE=3D2>The format of the above arguments in the =
myWrapper.cmd causes CMD.EXE to substitute the 8.3 full path name of =
the &lt;N&gt;th arg in place of the %~sf&lt;N&gt; sequence.</FONT></P>

<P><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
bash $ #=3D=3D=3D do we have a 16-bit dos program?</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
bash $ if&nbsp; [ -8 `which myprog` ] ; then</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
more&gt;&nbsp;&nbsp;&nbsp;&nbsp; myprog&nbsp; `cygpath -8 </FONT>
<BR><FONT SIZE=3D2>&gt; /usr/local/mumble-very-long-name.dat`</FONT>
<BR><FONT SIZE=3D2>&gt; target</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
more&gt; else</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
more&gt;&nbsp;&nbsp;&nbsp;&nbsp; myprog&nbsp; `cygpath -w </FONT>
<BR><FONT SIZE=3D2>&gt; /usr/local/mumble-very-long-name.dat`</FONT>
<BR><FONT SIZE=3D2>&gt; target</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
more&gt;&nbsp; fi</FONT>
<BR><FONT SIZE=3D2>&gt; --or--</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
bash $&nbsp; exec16&nbsp; myProg&nbsp; `cygpath -w =
../folder/file`&nbsp; target</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Cordially,</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Dan St.Andre'</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; The GRILLON =
Group</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <A =
HREF=3D"mailto:grillon AT mindspring DOT com">mailto:grillon AT mindspring DOT com</A>=
</FONT>
<BR><FONT SIZE=3D2>&gt; --</FONT>
<BR><FONT SIZE=3D2>&gt; =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT>
<BR><FONT SIZE=3D2>&gt; The Tenth Amendment ... its not only a good =
idea, its the law!</FONT>
<BR><FONT SIZE=3D2>&gt; <A =
HREF=3D"http://www.law.cornell.edu/constitution/constitution.billofright=
s.html#amendmentx" =
TARGET=3D"_blank">http://www.law.cornell.edu/constitution/constitution.b=
illofrights.html#amendmentx</A></FONT>
</P>

<P><FONT =
SIZE=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT>
</P>

<P><FONT SIZE=3D2>Go in His love!</FONT>
</P>

<P><FONT SIZE=3D2>W. Terry Lincoln - Senior =
Engineer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \&nbsp;&nbsp;&nbsp;&nbsp; =
\&nbsp;&nbsp; _&nbsp;&nbsp; /</FONT>
<BR><FONT SIZE=3D2>Ultimate Technology =
Corporation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
\&nbsp;&nbsp;&nbsp;&nbsp; \ |J| /</FONT>
<BR><FONT SIZE=3D2>a Tridex Company =
(NASDAQ:trdx)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp; \&nbsp;&nbsp;&nbsp;&nbsp; _|E|_</FONT>
<BR><FONT SIZE=3D2>ICQ# =
39362285&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \&nbsp;&nbsp; |_ S =
_|</FONT>
<BR><FONT SIZE=3D2>&lt;<A =
HREF=3D"mailto:WTerryLincoln AT engineer DOT com">mailto:WTerryLincoln AT engineer=
.com</A>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
\&nbsp;&nbsp;&nbsp; |U|</FONT>
<BR><FONT SIZE=3D2>&lt;<A =
HREF=3D"http://www.AngelFire.com/ny/TerryLincoln" =
TARGET=3D"_blank">http://www.AngelFire.com/ny/TerryLincoln</A>&gt;&nbsp;=
&nbsp;&nbsp; \ / |S| \</FONT>
<BR><FONT SIZE=3D2>&lt;<A =
HREF=3D"http://www.geocities.com/Eureka/Concourse/7326" =
TARGET=3D"_blank">http://www.geocities.com/Eureka/Concourse/7326</A>&gt;=
&nbsp; | |</FONT>
<BR><FONT =
SIZE=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D ~~~~~</FONT>
<BR><FONT SIZE=3D2>Opinions expressed do not represent the management =
of UTC.</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01BECD30.494F2340--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019