Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <408F78F9.8060306@yahoo.fr> Date: Wed, 28 Apr 2004 11:27:21 +0200 From: bertrand marquis Reply-To: bertrand_marquis AT yahoo DOT fr User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.2.1) Gecko/20030225 MIME-Version: 1.0 To: lassauge AT users DOT sourceforge DOT net Cc: "'cygwin AT sources DOT redhat DOT com'" Subject: Re: stat()/lstat() problem (?) References: <17F5FEED8AA6D41185B100508BAF1B0608E3EEC1 AT meteor DOT tls DOT fr DOT astrium DOT corp> In-Reply-To: <17F5FEED8AA6D41185B100508BAF1B0608E3EEC1@meteor.tls.fr.astrium.corp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on donald.sysgo.com X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00,UPPERCASE_25_50 autolearn=no version=2.61 X-AntiVirus: checked by AntiVir MailGate (version: 2.0.1.16; AVE: 6.25.0.2; VDF: 6.25.0.36; host: balu) X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i3S9POHr029435 ZXPLESPAC001, Ext a écrit: > Hi, > >here is my question/problem (see the example program below): >-----//-------- >#include > >#include >#include >#include > >static int is_dir(char * dr) >{ > struct stat st; > > if(stat(dr, &st) == -1) > { > perror("stat"); > return -1; > > } > if(lstat(dr, &st) == -1) > { > perror("lstat"); > return -1; > > } >} >int main(int argc,char **argv) >{ > int rc; > > rc=is_dir("//bin"); > rc=is_dir("/bin"); >} >-----//-------- > >With my version of cygwin(Windows NT Ver 4.0 Build 1381 Service Pack 6 - >cygwin 1.5.9-1) >the first call to is_dir() produces an error(stat: No such file or >directory) >BUT the same code was compiled and run on Linux (RH9) and Sun (Solaris2.8) >and >produces no errors !! > >The question is: >- is the behavior on Linux/Solaris normal ? I fact there ain't a '//bin' >only a '/bin', >but even all the shells treat them as representing the same path (BTW 'cd >//bin' on >cygwin/bash doesn't work ...) > this is a normal error under cygwin, you should look at the FAQ: // refers to network places >- is it an error in cygwin ? Did all pathes (oops is my english very clear >?) have to >treat dupplicated '/' as single '/' ? Is the notion of a pathname normalized >somewhere >(maybe posix ?) ? > you should remove all // under cygwin to avoid those errors see: http://cygwin.com/faq/faq_toc.html#TOC34 > > > >------------------------------------------------------------------------ > >--------------------------------------------------------- > >CE COURRIER ELECTRONIQUE EST A USAGE STRICTEMENT INFORMATIF ET NE SAURAIT ENGAGER DE QUELQUE MANIERE QUE CE SOIT EADS ASTRIUM SAS, NI SES FILIALES. > >SI UNE ERREUR DE TRANSMISSION OU UNE ADRESSE ERRONEE A MAL DIRIGE CE COURRIER, MERCI D'EN INFORMER L'EXPEDITEUR EN LUI FAISANT UNE REPONSE PAR COURRIER ELECTRONIQUE DES RECEPTION. SI VOUS N'ETES PAS LE DESTINATAIRE DE CE COURRIER, VOUS NE DEVEZ PAS L'UTILISER, LE CONSERVER, EN FAIRE ETAT, LE DISTRIBUER, LE COPIER, L'IMPRIMER OU EN REVELER LE CONTENU A UNE TIERCE PARTIE. > > > >This email is for information only and will not bind EADS Astrium SAS in any contract or obligation, nor its subsidiaries. > >If you have received it in error, please notify the sender by return email. If you are not the addressee of this email, you must not use, keep, disseminate, copy, print or otherwise deal with it. > >--------------------------------------------------------- > > > >------------------------------------------------------------------------ > >-- >Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple >Problem reports: http://cygwin.com/problems.html >Documentation: http://cygwin.com/docs.html >FAQ: http://cygwin.com/faq/ > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/