Mail Archives: cygwin/2001/09/01/00:51:37
Bonjour
excuse my english please.
I try to write a exe cgi who use ptread, fork and must read a
configuration file on win2k / IIS5 .
I test in command console -> OK
With navigator -> unable to read the configuration file (navigator and
IIS on the same machine )
I write a test.c file :
-------------------------------------------------------------------------------------------------------------
#include <stdio.h>
#include <windows.h>
#include <errno.h>
int main(int argc,char *argv[]) {
char szBuffer[MAX_PATH + 1];
DWORD dwNameSize = MAX_PATH +1;
FILE *fp;
int r=0,w=0,t;
char fichier[256];
unsigned char name[100];
printf("Content-type: text/plain\n\n");
GetCurrentDirectory(dwNameSize, &szBuffer);
strcpy(fichier,szBuffer);
printf("repertoire courant : %s\n\n",fichier);
strcpy(fichier,"test.conf");
fp=fopen(fichier,"r");
printf("Valeur de fichier : %s\n",fichier);
if (fp==0) {
printf("Erreur %d %s.\n\n",errno,strerror(errno));
}
else {
printf("Ouverture de %s : OK\n\n",fichier);
fclose(fp);
}
strcpy(fichier,"d:/sites_locaux/site_test/cgi-bin/test.conf");
fp=fopen(fichier,"r");
printf("Valeur de fichier : %s\n",fichier);
if (fp==0) {
printf("Erreur %d %s \n\n",errno,strerror(errno));
}
else {
printf("Ouverture de %s : OK\n\n",fichier);
fclose(fp);
}
}
-------------------------------------------------------------------------------------------------------------
work fine if compiled with VC++ 5 , in console or navigator ;
ie5 response :(http://127.0.0.1:888/cgi-bin/test.exe)
-----------------------------------------------------------------------
repertoire courant : D:\sites_locaux\site_test
Valeur de fichier : test.conf
Ouverture de test.conf : OK
Valeur de fichier : d:/sites_locaux/site_test/cgi-bin/test.conf
Ouverture de d:/sites_locaux/site_test/cgi-bin/test.conf : OK
------------------------------------------------------------------------
work in console, but not in navigator if compiled with cygwin :
console response:
-----------------------------------------------------------------------
Content-type: text/plain
repertoire courant : D:\sites_locaux\site_test\cgi-bin
Valeur de fichier : test.conf
Ouverture de test.conf : OK
Valeur de fichier : d:/sites_locaux/site_test/cgi-bin/test.conf
Ouverture de d:/sites_locaux/site_test/cgi-bin/test.conf : OK
--------------------------------------------------------------------------
ie5 response :(http://127.0.0.1:888/cgi-bin/test.exe)
-----------------------------------------------------------------------
repertoire courant : D:\sites_locaux\site_test
Valeur de fichier : test.conf
Erreur 2 No such file or directory.
Valeur de fichier : d:/sites_locaux/site_test/cgi-bin/test.conf
Erreur 2 No such file or directory
-----------------------------------------------------------------------
a copy of test.conf is in "d:/sites_locaux/site_test" and in
"d:/sites_locaux/site_test/cgi-bin"
The size of test.exe is 32 Ko with VC++, and 21 Ko with cygwin ( use of
cygwin1.dll ?).
I try to modify directory separator ( / , // , \\, \\\\) , files and IIS
permissions without good results.
I know well perl cgi , WinNT and IIS, but i am newbie in c/c++.
Tank-you for reply
Cordialement
Jean Minette
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -