Mail Archives: cygwin/2003/05/26/11:31:29
--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 -