Date: Sun, 5 Oct 1997 12:56:09 -0400 (EDT) Message-Id: <199710051656.MAA02764@delorie.com> To: Eli Zaretskii From: Alexander Bokovoy Cc: DJGPP mailing list Subject: Re[2]: Long to short filename converter In-Reply-To: References: <3436C7FA DOT 3BAF AT cyber-quest DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk How about Long->Short name converter that works not only in Win'95 DOS box but in raw DOS on the machine with VFAT partition? May Jeff assumed this? The problem is in the suggestion that if a program uses long names that it runs in DOS box under Win'95 but it not true for every cases - a program must work perfectly in raw DOS (with using 8.3 shortcuts instead long names) but in a source all file names will be long. If anybody write such thing it would be beautiful and helpful tool. On Sun, 5 Oct 1997 17:37:23 +0200 (IST) Eli Zaretskii wrote: > > On Sat, 4 Oct 1997, Jeff Taylor wrote: > > > Is there a long to short filename converter program available? Id like > > to write a bash script that takes long file names and quietly converts > > them to short (8.3) filenames before passing them to a older program > > without LFN support. > [snipped] > > If you haven't set NameNumericTail to 0, and you need to convert the > long name to its precise short alias (such as "Program Files" -> > PROGRA~1), you will have to use a special function of Interrupt 21h > (write a short program that gets a long name and prints its short > variety). The following excerpt is from Ralf Brown's Interrupt List > (note that this call will fail for non-existing files): > > --------D-217160CL01------------------------- > INT 21 - Windows95 - LONG FILENAME - GET SHORT (8.3) FILENAME FOR FILE > AX = 7160h > CL = 01h > CH = SUBST expansion flag > 00h return a path containing true path for a SUBSTed drive letter > 80h return a path containing the SUBSTed drive letter > DS:SI -> ASCIZ long filename or path > ES:DI -> 67-byte buffer for short filename > Return: CF set on error > AX = error code > 02h invalid component in directory path or drive letter only > 03h malformed path or invalid drive letter > ES:DI buffer unchanged > CF clear if successful > ES:DI buffer filled with equivalent short filename (full path, > even if relative path given, and all uppercase) > Note: this call returns the short name for any long-filename portions of > the provided pathname or filename > SeeAlso: AH=60h,AX=7160h/CL=00h,AX=7160h/CL=02h Alexander Bokovoy, ---== The Soft Age coming soon ==---