![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help on adding file sizes | llsmr777 | UNIX for Dummies Questions & Answers | 1 | 09-18-2007 11:58 AM |
| BAD SUPER BLOCK - Run fsck with alternate super block number | admin wanabee | HP-UX | 1 | 09-08-2006 10:57 AM |
| How can I find the filesystem block size? | progressdll | AIX | 4 | 10-06-2005 06:55 AM |
| Distributing folders into set sizes | redturbo | Shell Programming and Scripting | 3 | 04-15-2004 05:36 AM |
| Directory sizes | TRUEST | UNIX for Dummies Questions & Answers | 3 | 09-24-2003 06:24 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
block sizes in filesystem
I was reading this thread
SCO Unix - Disk Space and it talks about Quote:
thanks |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Yes, but on a single system there may be mutiple unix filesystems - look at /etc/fstab
and try man fstab for more information. How to get blocksize differs from system to system. The only way I know that works on different systems is a simple chunk of code like this: Code:
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/statvfs.h>
extern int errno;
int disp(const char *path)
{
struct statvfs st;
int retval=statvfs(path, &st);
if(!retval)
fprintf(stdout,"%s %u\n", st.f_fstr, st.f_bsize);
else
{
fprintf(stderr, "%s %s\n", path, strerror(errno));
retval=1;
}
return retval;
}
int main(int argc, char **argv)
{
int i=0;
char path[512]={0x0};
int retval=0;
if(argc==1)
while(fgets(path, sizeof(path), stdin)!=NULL)
retval|=disp(path);
else
for(i=1; i<argc; i++)
retval|=disp(argv[i]);
return retval;
}
|
|
#3
|
|||
|
|||
|
thanks for your help
|
|||
| Google The UNIX and Linux Forums |