Consultor Eletrônico



Kbase 20122: How To Programatically Check File System Block Size.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/4/2009
Status: Unverified

GOAL:

How to programmatically check file system block size.

FIX:

The following is a C program that checks the size of your file system:

#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
main(argc, argv)
int argc;
char *argv[];
{
int ret=0;
struct stat stbuf;
ret = stat(argv[0], &stbuf);
printf("st_blksize = %d, ret %d\n",stbuf.st_blksize,ret);
}

To compile and run the program:

: cc file.c

: ./a.out