Re: Problem with stat

2007-06-28 Thread Brian Ford
On Thu, 28 Jun 2007, Erich Dollansky wrote: > > According to Erich Dollansky on 6/26/2007 6:57 AM: > >>if (stat ("/usr/X11R6/share/doc/lesstif-0.94.4/html/Lessdox", &Stat) > > is is right that the link is pointing to itself resulting in an endless > loop? No, it points to its parent directory

Re: Problem with stat

2007-06-27 Thread Erich Dollansky
Hi, Eric Blake wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Erich Dollansky on 6/26/2007 6:57 AM: 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)

Re: Problem with stat

2007-06-27 Thread David Kastrup
Eric Blake <[EMAIL PROTECTED]> writes: > Matthew Woehlke users.sourceforge.net> writes: > >> >> "If the named file is a symbolic link, the stat() function shall >> >> continue pathname resolution using the contents of the symbolic >> >> link, and shall return information pertaining to the resulti

Re: Problem with stat

2007-06-26 Thread Eric Blake
Matthew Woehlke users.sourceforge.net> writes: > >> "If the named file is a symbolic link, the stat() function shall > >> continue pathname resolution using the contents of the symbolic > >> link, and shall return information pertaining to the resulting file > >> if the file exists." > > > > Thi

Re: Problem with stat

2007-06-26 Thread Matthew Woehlke
David Kastrup wrote: Eric Blake <[EMAIL PROTECTED]> writes: PCYMTNQREAIYR "If the named file is a symbolic link, the stat() function shall continue pathname resolution using the contents of the symbolic link, and shall return information pertaining to the resu

Re: Problem with stat

2007-06-26 Thread David Kastrup
Eric Blake <[EMAIL PROTECTED]> writes: > David Kastrup gnu.org> writes: > >> >> fstat, yes. But shouldn't stat be able to report S_ISLNK on a broken >> >> link? >> > >> > No. It must fail with ENOENT. >> > http://www.opengroup.org/onlinepubs/009695399/functions/stat.html >> >> No information t

Re: Problem with stat

2007-06-26 Thread Eric Blake
David Kastrup gnu.org> writes: > >> fstat, yes. But shouldn't stat be able to report S_ISLNK on a broken > >> link? > > > > No. It must fail with ENOENT. > > http://www.opengroup.org/onlinepubs/009695399/functions/stat.html > > No information there. "component of a path" has nothing to do wit

Re: Problem with stat

2007-06-26 Thread David Kastrup
Eric Blake <[EMAIL PROTECTED]> writes: > According to David Kastrup on 6/26/2007 7:10 AM: >> >> fstat, yes. But shouldn't stat be able to report S_ISLNK on a broken >> link? > > No. It must fail with ENOENT. > http://www.opengroup.org/onlinepubs/009695399/functions/stat.html No information the

Re: Problem with stat

2007-06-26 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to David Kastrup on 6/26/2007 7:10 AM: > > fstat, yes. But shouldn't stat be able to report S_ISLNK on a broken > link? No. It must fail with ENOENT. http://www.opengroup.org/onlinepubs/009695399/functions/stat.html - -- Don't work too h

Re: Problem with stat

2007-06-26 Thread Erich Dollansky
Hi, Eric Blake wrote: -BEGIN PGP SIGNED MESSAGE- Why is Lessdox not recognised as a link here? Because your program asked about what the link pointed to, and not about the link itself. The command line 'stat' uses lstat(), which is probably what you want your program to do. And thi

Re: Problem with stat

2007-06-26 Thread David Kastrup
Eric Blake <[EMAIL PROTECTED]> writes: > According to Erich Dollansky on 6/26/2007 6:57 AM: >>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)) >> pr

Re: Problem with stat

2007-06-26 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Erich Dollansky on 6/26/2007 6:57 AM: >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)) > pri

Re: Problem with stat

2007-06-26 Thread Erich Dollansky
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 ar

Re: Problem with stat

2007-06-26 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Erich Dollansky on 6/26/2007 4:00 AM: >>> When I run this little C++ program: >>> >>> PRIVATE VOID StatLessdox (VOID) >>> BEGIN ... >> This is NOT C++. Not without some obscure header included before the >> source. >> > this is why I menti

Re: Problem with stat

2007-06-26 Thread Erich Dollansky
Hi, Václav Haisman wrote: Erich Dollansky wrote: [...] When I run this little C++ program: PRIVATE VOID StatLessdox (VOID) BEGIN struct stat Stat; IF (stat ("/usr/X11R6/share/doc/lesstif-0.94.4/html/Lessdox", &Stat) == 0) THEN printf ("Mode: %lX\n", (unsigned long) Stat.st_m

Re: Problem with stat

2007-06-26 Thread Václav Haisman
Erich Dollansky wrote: [...] > > When I run this little C++ program: > > PRIVATE VOID StatLessdox (VOID) > BEGIN >struct stat Stat; > >IF (stat ("/usr/X11R6/share/doc/lesstif-0.94.4/html/Lessdox", &Stat) > == 0) THEN > printf ("Mode: %lX\n", (unsigned long) Stat.st_mode); >