[SOLVED] CS #include

$25

File Name: CS_#include.zip
File Size: 103.62 KB

5/5 - (1 vote)

#include
#include
#include

int main(int argc, char *argv[])
{
struct stat sb;

stat(argv[1], &sb);

printf(File type:);
switch (sb.st_mode & S_IFMT) {
case S_IFDIR:printf(directory
);break;
case S_IFREG:printf(regular file
); break;
default: printf(other
);break;
}
printf(Mode: %lo (octal)
,
(unsigned long) sb.st_mode);
printf(File size:%lld bytes
,
(long long) sb.st_size);
printf(Last file access: %s,
ctime(&sb.st_atime));

return 0;
}

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS #include
$25