www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/26/11:31:29

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Mon, 26 May 2003 11:26:22 -0400
From: Peter Davis <pfd AT pfdstudio DOT com>
To: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Cc: cygwin AT cygwin DOT com
Subject: Re: Behavior of stat() changed from NT to Win2000/XP
Message-ID: <20030526152622.GL4032@bitstream.com>
References: <20030526135811 DOT GK4032 AT bitstream DOT com> <Pine DOT GSO DOT 4 DOT 44 DOT 0305261002430 DOT 26092-100000 AT slinky DOT cs DOT nyu DOT edu>
Mime-Version: 1.0
In-Reply-To: <Pine.GSO.4.44.0305261002430.26092-100000@slinky.cs.nyu.edu>
User-Agent: Mutt/1.4i

--KDt/GgjP6HVcx58l
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, May 26, 2003 at 10:03:33AM -0400, Igor Pechtchanski wrote:
> On Mon, 26 May 2003, Peter Davis wrote:
> 
> > [snip]
> > Attached is a very simple program called stat, that just calls the
> > stat() function and displays the results.  It's called like this:
> > [snip]
> 
> Peter, FYI, there was no attachment in that message.
> 	Igor

Oops!  Here it is.

-pd


-- 
--------
                             Peter Davis
               Funny stuff at http://www.pfdstudio.com
    List of resources for children's writers and illustrators at:
                  http://www.pfdstudio.com/cwrl.html

--KDt/GgjP6HVcx58l
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="stat.c"

/*
  Stat a file
*/
#include <sys/stat.h>

int main (int argc, char **argv)
{
  struct stat filestat;

  stat (argv[1], &filestat);
  printf("st_dev: %d\n", filestat.st_dev);
  printf("st_ino: %d\n", filestat.st_ino);
  printf("st_mode: %d\n", filestat.st_mode);
  printf("st_nlink: %d\n", filestat.st_nlink);
  printf("st_uid: %d\n", filestat.st_uid);
  printf("st_gid: %d\n", filestat.st_gid);
  printf("st_rdev: %d\n", filestat.st_rdev);
  printf("st_size: %d\n", filestat.st_size);
  printf("st_atime: %d\n", filestat.st_atime);
  printf("st_mtime: %d\n", filestat.st_mtime);
  printf("st_ctime: %d\n", filestat.st_ctime);
  printf("st_blksize: %d\n", filestat.st_blksize);
  printf("st_blocks: %d\n\n", filestat.st_blocks);
}


--KDt/GgjP6HVcx58l
Content-Type: text/plain; charset=us-ascii

--
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/
--KDt/GgjP6HVcx58l--

- Raw text -


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