Mail Archives: djgpp/1997/09/26/08:30:20
Cesar Scarpini Rabak wrote:
>
> I'm experiencing some problems with DJGPP compiled programs running from a
> Netware 4.1 server.
>
> 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)
>
> The same behaviour happens if I use fnsplit and fnmerge functions to build a
> initialization filename from the executable name (argv[0]).
>
> Is there a work around or patch for this?
Here is something that might help in your own programs:
int main(int argc, char **argv){
int ls = strrchr(argv[0],'/')-argv[0];
char i3ecnf[256];
strncpy(PathToExe,argv[0],ls+1);
// Netware Fix for UNCs...
if( (PathToExe[0]=='/') && (PathToExe[1] =='/')){
PathToExe[0] = '\\';
PathToExe[1] = '\\';
}
}
The program gets argv[0] as
"//brain1/usr/home/demmer/foo.exe",
but if you change the // to \\, everything runs fine. (Under DOS6.22,
Netware 3.11
and VLM as requestor on weekdays ;-)
This snippet might help in your own code, but changes in libc are hard
and unlikely .
Opening files with a name
"\\brain1/usr/home/demmer/foo" is perfectly OK, I'm not sure about
stat() and such.
splitpath() and alikes will fail, 'cause I don't have the slightest idea
how to
pack the machine name into a drive letter. The only idea I have is to
have a table
of names and assign them characters from (char)128 on upwards, but
that may break too much existing code.
HTH
--
Ciao
Tom
*************************************************************
* Thomas Demmer *
* Lehrstuhl fuer Stroemungsmechanik *
* Ruhr-Uni-Bochum *
* Universitaetsstr. 150 *
* D-44780 Bochum *
* Tel: +49 234 700 6434 *
* Fax: +49 234 709 4162 *
* http://www.lstm.ruhr-uni-bochum.de/~demmer *
*************************************************************
- Raw text -