From: Christopher Heng Subject: Re: Library problems To: Eric Backus Date: Thu, 26 May 1994 12:07:10 +0800 (SST) Cc: djgpp Reply-To: chris%cyfhsite AT csar DOT csah DOT com 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 | +-------------------+-----------------------------------+