#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/stat.h>
#include <syscall.h>
Go to the source code of this file.
|
int | main (int argc, const char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
const char * |
argv[] |
|
) |
| |
Definition at line 12 of file stat.c.
13{
14 int status;
16
17 if (argc < 2) {
19 return 1;
20 }
21
22 if (argc > 2) {
23 fputs(
"Too many arguments, expected one\n",
stdout);
24 return 1;
25 }
26
27 status =
OSStat(argv[1], &sb);
28 if (status != 0) {
30 return 0;
31 }
32
33 printf(
" File: \"%s\"\n", argv[1]);
34 printf(
" Size: %d\n", sb.st_size);
35 printf(
"Blocks: %d\n", sb.st_blocks);
36 printf(
" Inode: %d\n", sb.st_ino);
37
38 return 0;
39}
int OSStat(const char *path, struct stat *sb)
int printf(const char *fmt,...)
int fputs(const char *str, FILE *fh)