Date: Mon, 31 May 1999 16:07:30 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: "K.C. Adams" cc: djgpp AT delorie DOT com Subject: Re: LFN vs Short(8.3) file names In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 31 May 1999, K.C. Adams wrote: > Trying to write a little commandline utility under windows 95. I need to > access the dos (short/8.3) filename as well as the windows LFN. One way is simply to push "LFN=n" into the environment (e.g. by calling `putenv' library function), then call any file-oriented function you want. When you need the long name again, push "LFN=y" into the environment and call the same function to get the long name. Alternatively, you could use a special function of Interrupt 21h provided by Windows for this (DJGPP library uses it internally when you call `system' or `spawnXX' functions). Here's an untested fragment that should do what you want: __dpmi_regs r; char short_name[FILENAME_MAX], long_name[FILENAME_MAX]; _put_path (long_name); r.x.ax = 0x7160; r.x.cx = 1; r.x.ds = r.x.es = __tb / 16; r.x.si = r.x.di = __tb & 15 __dpmi_int(0x21, &r); if (r.x.flags & 1) /* error return */ else dosmemget(__tb, FILENAME_MAX, short_name);