delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/07/14:16:27

Xref: news2.mv.net comp.os.msdos.djgpp:5711
From: alaric AT abwillms DOT demon DOT co DOT uk (Alaric B. Williams)
Newsgroups: comp.os.msdos.djgpp
Subject: [_dos_]find{first|next} problem!
Date: Sun, 07 Jul 1996 11:01:12 GMT
Lines: 55
Message-ID: <836737189.11199.0@abwillms.demon.co.uk>
NNTP-Posting-Host: abwillms.demon.co.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Say, does anyone have any idea why:

   ffblk _ffblk;
   int result = findfirst("*.PPM",&_ffblk,FA_ARCH | FA_RDONLY |
FA_HIDDEN | FA_SYSTEM);
   while(!result) {
      colours(_ffblk.ff_name);
      result = findnext(&_ffblk);
      ah.sprites++;
   }

and

   find_t _ffblk;
   wh.length = 0;
   int result = _dos_findfirst("*.RES",_A_ARCH | _A_RDONLY,&_ffblk);
   while(!result) {
      puts(_ffblk.name);
      wh.length++;
      result = _dos_findnext(&_ffblk);
   }

/BOTH/ give filenames with the first two characters missing???

IE, a directory containing

CTREE.RES
SM_FONT.RES


causes the second snippet to print:

REE.RES
_FONT.RES


>HELP!<


The same code worked fine in DJGPP v1.x, but fails in the latest v2
from SimTel...

Thanx,


ABW


--
I have become... Comfortably numb...

Alaric B. Williams Internet : alaric AT abwillms DOT demon DOT co DOT uk
<A HREF="http://www.hardcafe.co.uk/Alaric/">http://www.hardcafe.co.uk/Alaric/</A>

- Raw text -


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