www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/12/06/18:07:10

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: "Jeffrey Powell" <j-powell AT pb DOT jp DOT nec DOT com>
To: "'Eli Zaretskii'" <eliz AT is DOT elta DOT co DOT il>
Cc: <djgpp AT delorie DOT com>
Subject: RE: Broken findfirst
Date: Fri, 7 Dec 2001 08:04:19 +0900
Message-Id: <000201c17eaa$56f32540$1002a8c0@ygtynecs01097>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0)
In-Reply-To: <Pine.SUN.3.91.1011206115116.17549A-100000@is>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Importance: Normal
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Thank you.

This is consistent with the Unix side of things not the DOS side where you
have to specifically link in an object file to give the same functionality.


Jeff Powell
NEC CustomTechnica

-----Original Message-----
From: Eli Zaretskii [mailto:eliz AT is DOT elta DOT co DOT il]
Sent: Thursday, December 06, 2001 6:55 PM
To: Jeff Powell
Cc: djgpp AT delorie DOT com
Subject: Re: Broken findfirst


On Thu, 6 Dec 2001, Jeff Powell wrote:

> And compiling the file as .c yields the same results. Here is the whole
file.
>
> #include      <dos.h>
> //#include    <fcntl.h>
> #include      <stdio.h>
> #include      <string.h>
> #include      <dir.h>
>
> main(int ac, char **av)
> {
>       struct  ffblk   f;
>       int             iFndStatus;
>       char    cDrv[MAXDRIVE];
>       char    cDir[MAXDIR];
>       char    cNam[MAXFILE];
>       char    cExt[MAXEXT];
>       char    *MyStr;
>
> //    _use_lfn(av[1]);
>       fnsplit(av[1],cDrv, cDir, NULL, NULL);

I'm guessing that you invoked your program like this:

        yourprog C:\*.*

Is that right?  If so, av[1] didn't contain "C:\*.*", but the first file
in the C:\ directory.  That's because the DJGPP startup code
automatically expands wildcards in all the command-line arguments.  If
you want to pass the literal "C:\*.*" to a program, enclose it in double
or single quotes.  When I do that, your program works for me as you'd
expect: it prints all the files in the C:\ directory.

(That's why I asked you to tell what's in av[1], but I guess you didn't
actually look... ;-)

- Raw text -


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