Mail Archives: djgpp/2000/09/13/15:30:17
From: | "Tim 'Zastai' Van Holder" <zastai AT hotmail DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
References: | <M9lv5.421$Tn3 DOT 8133 AT news010 DOT worldonline DOT dk> <lcisrs00nlas0p2b1hjbme4so0eok7v8pe AT 4ax DOT com>
|
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: | <qqQv5.9918$R_2.94366@afrodite.telenet-ops.be>
|
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" <Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p> wrote in
message news:lcisrs00nlas0p2b1hjbme4so0eok7v8pe AT 4ax DOT com...
> On Tue, 12 Sep 2000 07:44:44 GMT, "Sven-Erik Bak"
> <seb AT techno-matic DOT dk> 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
<inodenum> = <inodenum in stat of long file name>. (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
:)
- Raw text -