Date: Wed, 22 Dec 1999 10:12:53 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: shanec AT mindspring DOT com cc: djgpp AT delorie DOT com Subject: Re: UNC with djgpp? In-Reply-To: <83oc65$su$1@nnrp1.deja.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 21 Dec 1999 shanec AT mindspring DOT com wrote: > C:\djgpp\bin>rm \\ga016f95\sys\cla\shane\test > c:/djgpp/bin/rm: //ga016f95/sys/cla/shane/test: No such file or > directory (ENOENT) Short answer: DJGPP doesn't support UNCs, so you cannot have them. Long answer: supporting UNCs in the library is a royal pain because DOS functions don't accept UNC pathnames, they need a drive letter. However, DOS doesn't have any way of mapping a UNC to the corresponding drive letter, except by walking the list of 32 possible drives and finding its UNC. You need to do that walk for every system call that uses a UNC, since the mapping between UNCs and drive letters is dynamic and can change behind your back. This would tremendously slow down the library functions that refer to file names. So we don't do that. The reason that `rm' (and all the other programs from the Fileutils package) convert all backslashes to forward slashes is that the assumption about forward slashes is scattered throughout the entire sources of all the programs. By converting the backslashes up front, the DJGPP port supports DOS-style file names with backslashes without requiring a massive amount of changes to the program sources. > The reason for this is due to the threading nature of a program I > wrote. I can easily exceed the maximum number of mapped drives > available to the OS, so UNCs are used to access server resourcers > without tying up a drive letter. I suggest to rethink this design decision. You have up to 32 drives at your disposal; if that is not enough (but please explain why), I'm sure alternative solutions could be found if you explain what are you trying to do that you need so many different drives. Going the UNC path is IMHO a dead end.