X-Spam-Check-By: sourceware.org Message-ID: <46810D24.9000303@pacific.net.sg> Date: Tue, 26 Jun 2007 16:57:08 +0400 From: Erich Dollansky User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Problem with stat References: <46808EA8 DOT 2030202 AT pacific DOT net DOT sg> <4680DD73 DOT 8090300 AT sh DOT cvut DOT cz> <4680E3A0 DOT 3020508 AT pacific DOT net DOT sg> <4680FE40 DOT 7010102 AT byu DOT net> In-Reply-To: <4680FE40.7010102@byu.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Hi, Eric Blake wrote: > > If it were truly C++, you would have also showed the include files and > preprocessor macros that you used. If you want help on this issue, > provide a COMPILABLE example, and preferably one that is not so masked by > macros that it looks more like pascal than C++. > here we are. The problem has nothing to do with the program. #include #include int main (int argc, char ** argv) { int res; struct stat Stat; res = 0; if (stat ("/usr/X11R6/share/doc/lesstif-0.94.4/html/Lessdox", &Stat) == 0) { printf ("Mode: %lX\n", (unsigned long) Stat.st_mode); if (S_ISDIR (Stat.st_mode)) printf ("Directory flag is set.\n"); if (S_ISREG (Stat.st_mode)) printf ("Is a regular file.\n"); if (S_ISLNK (Stat.st_mode)) printf ("Link flag is set.\n"); } } plus the make file CFLAGS += -I . \ -funsigned-char \ -Wall Inter = Inter/ Run = Run/ obj = .obj exe = .exe make = .make All: test${make} \ teststat.cpp \ ${Inter}teststat${obj} \ ${Run}teststat${exe} ${Inter}teststat${obj}: teststat.cpp g++ ${CFLAGS} -c teststat.cpp -o ${Inter}teststat${obj} ${Run}teststat${exe}: ${Inter}teststat${obj} g++ ${CFLAGS} \ ${Inter}teststat${obj} \ -o ${Run}teststat${exe} The result is the same as before. Erich -- 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/