Mail Archives: djgpp/1994/05/26/02:24:30
In a previous message, Eric Backus wrote:
>
> 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.
There's no easy documented way to do this. The undocumented way to do this
is to look up the file handle in the undocumented DOS system file table.
That'll yield only the filename (without path prefix). Getting a complete
pathname is even a greater pain. Probably involves getting the cluster
number stored in the DOS internal system file table, and presumably going
through each directory entry (starting from the root?) and comparing
name/cluster. (ugh!)
Doesn't seem worth it (or even reliable for that matter).
Regards,
Chris Heng.
--
+-------------------+-----------------------------------+
| Christopher Heng | Internet: chris%cyfhsite AT csah DOT com |
| Singapore | csah.com!cyfhsite!chris |
+-------------------+-----------------------------------+
- Raw text -