From: "Tim 'Zastai' Van Holder" Newsgroups: comp.os.msdos.djgpp References: Subject: Re: How do I get the msdos "long" (x~1.y) filename when I know the real windows long filename Lines: 36 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: Date: Wed, 13 Sep 2000 19:18:46 GMT NNTP-Posting-Host: 213.224.94.44 X-Complaints-To: abuse AT pandora DOT be X-Trace: afrodite.telenet-ops.be 968872726 213.224.94.44 (Wed, 13 Sep 2000 21:18:46 MET DST) NNTP-Posting-Date: Wed, 13 Sep 2000 21:18:46 MET DST Organization: Pandora - Met vlotte tred op Internet To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Damian Yerrick" wrote in message news:lcisrs00nlas0p2b1hjbme4so0eok7v8pe AT 4ax DOT com... > On Tue, 12 Sep 2000 07:44:44 GMT, "Sven-Erik Bak" > wrote: > > >Is there a command that says "get_short(filename)" and returns > >the short filename that is actually used in dos. > > > >I have tried the "_lfn_gen_short_fname();" in the library but > >this is the result > > > >"_lfn_gen_short_fname();" > > THISISALONG.NAME -> THISISAL.NAM > > Dos interpretation > > THISISALONG.NAME -> THISIS~1.NAM > > Have you tried Ralf Brown's Interrupt List? Windows 9x and 2000 > have some syscalls to help you out with this. > A poor man's alternative would be to generate candidate names yourself (ie collapsing spaces and dots, replacing illegal chars by underscores, and appending the numeric tail, ...) and then using stat until you find one with = . (of course, the appropriate flag must be set for this value to be computed; see 'info libc stat'). Of course, if you're not afraid to use interrupts, this roundabout way isn't needed (but I suspect this method will also work in plain DOS, while the interrupts might not). -- Hi, I'm a signature virus. plz set me as your signature and help me spread :)