www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/29/23:14:53

Message-ID: <329FB276.78EE@wyellowstone.com>
Date: Fri, 29 Nov 1996 21:05:10 -0700
From: RConover AT wyellowstone DOT com (Rusty Conover)
Organization: RusProg Development
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: findfirst function

Hello,

I am having trouble using the findfirst() function, when I use the 
example in the docs and when I write my own function the same event 
occurs.  The filename's first two characters are dropped, and the file's 
size is totally wrong.  I am inserting a code sample below:

int dirtest() {
struct ffblk f;
int done = findfirst("*.*", &f, FA_ARCH|FA_RDONLY);
while (!done)
{
printf("%10u %2u:%02u:%02u %2u/%02u/%4u %s\n",
f.ff_fsize,
(f.ff_ftime >>11) & 0x1f,
(f.ff_ftime >>5) & 0x3f,
(f.ff_ftime & 0x14) * 2,
(f.ff_fdate >> 5) & 0x0f,
(f.ff_fdate & 0x14),
((f.ff_fdate >> 9) & 0x7f) + 1980,
f.ff_name);
done = findnext(&f);
}
}

Could you please find out what I or the docs are doing wrong, and let me 
know.  Thank you for your time.

Rusty Conover
RConover AT wyellowstone DOT com

- Raw text -


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