![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| size of directory | redbeard_06 | Shell Programming and Scripting | 19 | 08-08-2008 01:08 AM |
| size of directory with ls -l | pascalbout | AIX | 2 | 02-21-2006 12:21 PM |
| size of a directory | collins | High Level Programming | 6 | 10-15-2004 02:08 PM |
| size of a directory? | yls177 | UNIX for Dummies Questions & Answers | 2 | 11-25-2002 06:44 AM |
| Size of a directory | minazk | Shell Programming and Scripting | 9 | 10-01-2002 03:03 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Size of Directory
I have a C program to find out the total size of all the files in a directory.
So what it does is.. it scans through all the files in the directory and does a stat() on each of them and sums up the size returned by st_size . Is there a quicker way to do this.. without doing a stat() on each one of them ? Basically I want to find the total size occupied by all files in a directory thanks, the tantric ! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
There is no quicker way to do it. And doing it right might be a bit harder than that. Consider:
Code:
$ echo stuff > file1 $ ln file1 file2 $ ls -is1 file1 file2 79074 1 file1 79074 1 file2 $ |
||||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|