B20: cygpath doesn't handle 8.3 tilde names
Lincoln, W. Terry
terryl@ultimatetechnology.com
Sat Jul 31 18:34:00 GMT 1999
Title: RE: B20: cygpath doesn't handle 8.3 tilde names
> -----Original Message-----
> From: Dan St.Andre' [ mailto:saint@savantage.com ]
> Sent: Monday, July 12, 1999 5:47 PM
> To: cygwin@sourceware.cygnus.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@mindspring.com
> --
> ==============================================================
> The Tenth Amendment ... its not only a good idea, its the law!
> http://www.law.cornell.edu/constitution/constitution.billofrights.html#amendmentx
==============================================================
Go in His love!
W. Terry Lincoln - Senior EngineerÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ \ÃÂ ÃÂ ÃÂ ÃÂ \ÃÂ ÃÂ _ÃÂ ÃÂ /
Ultimate Technology CorporationÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ \ÃÂ ÃÂ ÃÂ ÃÂ \ |J| /
a Tridex Company (NASDAQ:trdx)ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ \ÃÂ ÃÂ ÃÂ ÃÂ _|E|_
ICQ# 39362285ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ \ÃÂ ÃÂ |_ S _|
< mailto:WTerryLincoln@engineer.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.
More information about the Cygwin
mailing list