Problem with stat

Erich Dollansky oceanare@pacific.net.sg
Tue Jun 26 09:28:00 GMT 2007


Hi,

I have a problem with either understanding the C function stat or with 
cygwin.

When I run stat from the console I get this:

   File: `Lessdox' -> `/usr/X11R6/share/doc/lesstif-0.94.4/html'
   Size: 40           Blocks: 1          IO Block: 1024   symbolic link
Device: e491f35dh/3834770269d Inode: 1125899906895407  Links: 1
Access: (0777/lrwxrwxrwx)  Uid: ( 1005/   Erich)   Gid: (  545/Utilisateurs)
Access: 2007-06-26 07:42:49.979648000 +0400
Modify: 2007-04-27 16:52:21.254708800 +0400
Change: 2007-04-27 16:52:21.254708800 +0400


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);
       IF (S_ISDIR (Stat.st_mode)) THEN
          printf ("Directory flag is set.\n");
       END;
       IF (S_ISREG (Stat.st_mode)) THEN
          printf ("Is a regular file.\n");
       END;
       IF (S_ISLNK (Stat.st_mode)) THEN
          printf ("Link flag is set.\n");
       END;
    END;
END;

I get this:

Mode: 41F8
Directory flag is set.

I do not get the message 'Link flag is set.'

Why is Lessdox not recognised as a link here?

I run cygwin as current of last week.

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/



More information about the Cygwin mailing list