Mail Archives: djgpp/1998/05/28/13:04:09
On Thu, 28 May 1998, Anthony Appleyard wrote:
> In assembling pathnames it is easy to forget that root level directory names
> end in a \, e.g. C:\ , and so to make up a pathname containing two consecutive
> \ characters, e.g. C:\\MYFILE.TXT . I have found the hard way that if you call
> `AX=0x7160, CX=2 (or 0x8002), int21' to find the longname given the shortname,
> if the shortname starts with a drive letter, colon, and TWO \ as above, that
> interrupt call takes <<several seconds>> to run even on a very fast new PC,
> instead of quickly faulting and exiting.
This is most probably because two slashes at the beginning is taken by
Windows as a network share (aka UNC), a name that points to another
machine. So Windows goes to the network and looks for a machine with a
non-existent name, and you wait...
To make this problem go away, always use forward slashes, and call DJGPP
functions whenever possible. DJGPP library transparently collapses all
consecutive slashes to a single slash before calling DOS interrupts, but
it only does so for forward slashes.
As for function 7160h, you can just call `_truename' from the DJGPP
library, it does the same. But you get the above slash-collapsing
feature for free, while using it.
- Raw text -