X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Mike C" Newsgroups: comp.os.msdos.djgpp Subject: intdos question Lines: 56 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Message-ID: Date: Fri, 14 Jan 2005 16:45:08 GMT NNTP-Posting-Host: 62.253.115.224 X-Complaints-To: http://www.ntlworld.com/netreport X-Trace: newsfe3-gui.ntli.net 1105721108 62.253.115.224 (Fri, 14 Jan 2005 16:45:08 GMT) NNTP-Posting-Date: Fri, 14 Jan 2005 16:45:08 GMT Organization: ntl Cablemodem News Service To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Can somebody please point me in the right direction? I have written a parser, which parses a source file and creates a destination file. To operate the program, I select the source file in Windows explorer and drag it onto a shortcut to my program. This leaves the path to the source file in argv[1]. My problem is that the string that I find in argv[1] is all in DOS 8.3 format. I would like to name the destination file the same as the source file, with a long filename, changing only the extension. As I know the short filename, I thought of using findfirst() and findnext() to locate the long filenames, then generate the short filename for each one and compare it to the known short filename. Simple in concept! I have been looking at Ralph Brown's interrupt list, int21, AX=7160. It says : AX = 7160h CL = 00h 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 filename or path (either long name or short name) ES:DI -> 261-byte buffer for canonicalized name 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 fully qualified name AX destroyed ... so I guess I need to load DS:SI with a pointer to my long filename buffer, and it will return a pointer to the short filename in ES:DI, but that's where I get stuck. I'm not very familiar with the Intel registers. How do I get my pointer into DS:SI? If I'm not mistaken, SI is an index register that gets added to DS? How do I work it all out? With thanks to anybody who spends their precious time on this, MikeC -- WARNING: My e-mail return address is bogus to confuse the automated spam address gatherers. Mental decryption required: mike*e-col#ntlworld*com where * = 'dot' and # = 'at'