Mail Archives: djgpp/1994/05/25/14:47:08
You wrote:
> The following is a list of problems with the library as of 1.11maint5, which
> I discovered and which were identified as ``bugs'' by DJ:
...
> 4) stat() and fstat() return inconsistent results for the same file.
> The st_blksize field is reported as 4096 (correct) by fstat(),
> but stat() returns 512 (incorrect) in it. stat() returns a
> unique value for each file in the st_ino field, whereas fstat()
> always returns 0 there. (Beware programs that use this field to
> infer that files with the same st_ino are actually the same
> file.)
One way to make fstat() and stat() consistant would be to have fstat()
call stat(). There must be some way to ask DOS for the pathname
associated with the file pointer that fstat() gets, but I'm not a DOS
expert so I don't know how to do that.
About st_blksize:
Isn't 512 the true disk blocksize? If not, is 4096 always the correct
value, or does it vary depending on how the disk is layed out? Is
there a way to ask DOS and fill this field in correctly?
--
Eric Backus
ericb AT lsid DOT hp DOT com
(206) 335-2495
- Raw text -