Sender: nate AT cartsys DOT com Message-ID: <363CF69D.DE8E8575@cartsys.com> Date: Sun, 01 Nov 1998 16:02:37 -0800 From: Nate Eldredge X-Mailer: Mozilla 4.05 [en] (X11; I; Linux 2.0.35 i486) MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: Listing long filenames References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com 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