Date: Sun, 28 Sep 1997 18:31:20 +0200 (IST) From: Eli Zaretskii To: Cesar Scarpini Rabak cc: djgpp AT delorie DOT com Subject: Re: libc functions handling of UNCs In-Reply-To: <1.5.4.32.19970925193854.0068fd8c@dce03.ipt.br> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 25 Sep 1997, Cesar Scarpini Rabak wrote: > I'm experiencing some problems with DJGPP compiled programs running from a > Netware 4.1 server. Is it on DOS or Windows 95? > In a nutshell the easier way to show the problem is this sequence of commands: > > C:\>truename f: > \\URASERVER_II\SYS > C:\>ls \\URASERVER_II\SYS > z:/djgpp/bin/ls: //URASERVER_II/SYS: No such file or directory > (ENOENT) This is a known problem: DJGPP doesn't support UNCs in pathnames. They might work in some DOS calls, especially on Windows 95, where Windows itself supports UNCs. But some calls will fail; it depends on your netware and the OS which ones are they. And DJGPP internally doesn't know about UNCs at all, except a few specific places like `getmntent'. In particular, it doesn't know that the two leading backslashes shouldn't be converted to forward slashes and shouldn't be collapsed into a single slash when passing the pathname to DOS. The reason for the lack of support for UNCs is that there's no way of knowing what DOS drive letter corresponds to the given UNC. In your case, we need to know that \\URASERVER_II\SYS corresponds to drive F:. The only way that I know of to find out this mapping is to loop through all the 32 possible drives and query the net about the networked name of that drive (even `_truename' won't always return the UNC). And that is prohibitively slow. (We need the DOS drive letter, because some DOS calls only work with drive letters, at least on MS-DOS and Windows 3.X.) > Is there a work around or patch for this? No patch. I doubt if there is a workaround for all cases. What Thomas suggested, might or might not work in your case. It all depends what network software do you use and what is your OS. Btw, why did you at all tried to call `ls' with the UNC? "ls f:" should have worked, AFAIK, and that is how `ls' and other DJGPP programs are supposed to work.