From: ahoward Date: 2003-01-29T01:42:03+09:00 Subject: Re: FileTest.size? vs du -b On Tue, 28 Jan 2003, Curious Person wrote: > Er... something doesn't add up. BTW, when I verify the filesizes with ls - > al, it matches what FileTest.size returns. Does anyone know what's going > on here? Is du inaccurate? du -> 'disk usage' this is the amount of disk used by the file, it will always be a multiple of the block size whether or not you ask du to show this in bytes or whatever FileTest.size reports the actual size of the file as reported by stat. this is the actual length of the file. so accurate depends on you viewpoint : if you are concerned about the total size of files on disk the du is more accurate, if you simply want to know the size of a file to, for example, read it into a malloc'd array then stat (FileTest.size) is the way to go. all you can really count on is that du file >= stat.size file -a -- ==================================== | Ara Howard | NOAA Forecast Systems Laboratory | Information and Technology Services | Data Systems Group | R/FST 325 Broadway | Boulder, CO 80305-3328 | Email: ahoward@fsl.noaa.gov | Phone: 303-497-7238 | Fax: 303-497-7259 ====================================