Mail Archives: djgpp/1998/11/01/19:04:53
Eli Zaretskii wrote:
> > Or otherwise, if I have a FILE *, how can I get the long filename for this
> > file ?
>
> AFAIK, there is no way to do this on DOS/Windows. Actually, I think
> Unix doesn't have such service either.
You could do it by finding the file handle with `fileno'. From this you
can search some undocumented DOS data structures and find the drive and
starting cluster, and then read through all the directory entries on the
drive to find which one has that starting cluster. It would be
extremely slow, unwieldly, and fragile. Basically: Don't do it.
On Unix it's slightly easier, but the idea is the same. You find the
file's inode, and search the whole filesystems for the file(s) with that
inode number. It's complicated there because of hard links, whereby one
file with one inode may have multiple names.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -