delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/06/26/05:28:31

X-Spam-Check-By: sourceware.org
Message-ID: <46808EA8.2030202@pacific.net.sg>
Date: Tue, 26 Jun 2007 07:57:28 +0400
From: Erich Dollansky <oceanare AT pacific DOT net DOT sg>
User-Agent: Thunderbird 2.0.0.4 (Windows/20070604)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Problem with stat
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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,

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019