www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/29/16:53:10

From: "Richard L.F. van Paasen" <R DOT L DOT F DOT v DOT Paasen AT stud DOT tue DOT nl>
Newsgroups: comp.os.msdos.djgpp
Subject: findfirst() findnext() bug?
Date: Sun, 29 Sep 1996 21:34:49 -0700
Organization: University of Technology Eindhoven
Lines: 57
Message-ID: <324F4DE9.70FC@stud.tue.nl>
Reply-To: R DOT L DOT F DOT v DOT Paasen AT stud DOT tue DOT nl
NNTP-Posting-Host: annex1s7.urc.tue.nl
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,

When I use the findfirst() and findnext() functions of libc,
the first 2 characters of the names in ffblk.ff_name dissapear.
Is this a bug in libc.a ? With Borland C, this works fine.

The program:

#include <dir.h>
#include <iostream.h>

int main(void)
{ struct ffblk fblk;
  char ftemp[MAXPATH]=3D"c:/data/*.*";
	=

  if (!findfirst(ftemp,&fblk,FA_DIREC))
  do
  { if (fblk.ff_attrib & FA_DIREC) =

    { cout << "Dir: ";
      cout << fblk.ff_name << "\n";
    }
  } while(!findnext(&fblk));

  return 0;
}

Gives as result:

Dir:       outsid=01>P=80=020
Dir: =

Dir: _SPR
Dir: SIC
Dir: G
Dir: XT
Dir: NDOWS
Dir: ET

While the directory c:/data contains:


 Volume in drive C has no label
 Volume Serial Number is 212C-73A8
 Directory of C:\DATA

=2E            <DIR>         06-08-96   15:15
=2E.           <DIR>         06-08-96   15:15
DB_SPR       <DIR>         06-08-96   15:16
MUSIC        <DIR>         06-08-96   15:16
PRG          <DIR>         06-08-96   15:17
TEXT         <DIR>         06-08-96   15:18
WINDOWS      <DIR>         06-08-96   15:19
INET         <DIR>         06-08-96   15:43
        8 file(s)              0 bytes
                     142.958.592 bytes free

- Raw text -


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