delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2008/07/17/16:48:04

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Rugxulo <rugxulo AT gmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Drag and Drop to Command Line
Date: Thu, 17 Jul 2008 13:31:46 -0700 (PDT)
Organization: http://groups.google.com
Lines: 49
Message-ID: <1be42d92-897a-4d17-9878-1794316d728b@e53g2000hsa.googlegroups.com>
References: <I6-dnUDsEJnAOebVnZ2dnUVZ_rPinZ2d AT lmi DOT net> <g5hn11$bst$1 AT aioe DOT org>
NNTP-Posting-Host: 65.13.115.246
Mime-Version: 1.0
X-Trace: posting.google.com 1216326706 8764 127.0.0.1 (17 Jul 2008 20:31:46 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Thu, 17 Jul 2008 20:31:46 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: e53g2000hsa.googlegroups.com; posting-host=65.13.115.246;
posting-account=p5rsXQoAAAB8KPnVlgg9E_vlm2dvVhfO
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9)
Gecko/2008052906 Firefox/3.0,gzip(gfe),gzip(gfe)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m6HKj5rl023472
Reply-To: djgpp AT delorie DOT com

Hi,

On Jul 15, 3:25 am, "Rod Pemberton" <do_not_h DOT  DOT  DOT  AT nohavenot DOT cmm> wrote:
>
> Although I like Sandmann's solution (Hey, how've you been?), the DJGPP
> solution would be to call the DOS LFN API (see RBIL, Int 0x21, AX=71xxh).  I
> recently had the opposite problem.  I needed SFN's for PKZIP (PKZIPFIX,
> actually) on XP.  My app. (for DJGPP v2.03) calls Int 0x21, AX=71A0h to
> determine if LFN's are available, then calls Int 0x21, AX=7160h to convert
> the LFN to SFN.  You should be able to call 7160 to convert an SFN to LFN
> too.  7160 returns the full path (cl=0), short filename (cl=1), or long
> filename (cl=2).  My app. worked on XP SP1 and SP2.  I'm not sure about the
> original version or the new SP3.

You could always just use CMD extensions (e.g. the "for" command):

------------------------------------------------------------------------------------------------------------------------
[ Vista ] - Thu 07/17/2008 >for %a in (paq8o8z-jul4.zip) do echo %a

[ Vista ] - Thu 07/17/2008 >echo paq8o8z-jul4.zip
paq8o8z-jul4.zip

[ Vista ] - Thu 07/17/2008 >for %a in (paq8o8z-jul4.zip) do echo %~sa

[ Vista ] - Thu 07/17/2008 >echo c:\Armslurp\temp\paq8o8z\PAQ8O8~1.ZIP
c:\Armslurp\temp\paq8o8z\PAQ8O8~1.ZIP

[ Vista ] - Thu 07/17/2008 >for %a in (paq8o8z-jul4.zip) do echo
%~snxa

[ Vista ] - Thu 07/17/2008 >echo PAQ8O8~1.ZIP
PAQ8O8~1.ZIP

[ Vista ] - Thu 07/17/2008 >for %a in (paq8o8z-jul4.zip) do echo %~fa

[ Vista ] - Thu 07/17/2008 >echo c:\Armslurp\temp\paq8o8z\paq8o8z-
jul4.zip
c:\Armslurp\temp\paq8o8z\paq8o8z-jul4.zip
------------------------------------------------------------------------------------------------------------------------

Might be easier than rewriting the thing.   ;-)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019