Mail Archives: djgpp/1996/11/30/02:06:41
Rusty Conover wrote:
>
> 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:
>
> Could you please find out what I or the docs are doing wrong, and let me
> know. Thank you for your time.
This is a well-known bug in <dir.h> of DJGPP v2.00, caused by the fact
that the gcc 2.7.2 compiler does not pack structs correctly in C++. The
workaround is to find the struct ffblk definition in <dir.h> and
surround it with:
#pragma pack(1)
...
#pragma pack()
The solution is to get the latest version of DJGPP, v2.01, which
includes fixed header files and (I think) a fixed gcc. Be sure to
download the latest version of gcc, 'gcc2721b.zip'.
BTW, this problem is described in detail in the DJGPP FAQ
(v2/faq202b.zip), section 22.10.
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com |
| Proud owner of what might one | http://www.cs.com/fighteer |
| day be a spectacular MUD... | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------
- Raw text -