Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3B906920.177B561C@loracom.fr> Date: Sat, 01 Sep 2001 06:50:40 +0200 From: Jean Minette X-Mailer: Mozilla 4.7 [fr] (WinNT; I) X-Accept-Language: fr MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: v 1.3.2 : file acces problem by IIS Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 #include #include 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/