holes in files

John F Haugh II jfh at rpp386.cactus.org
Sat Dec 8 01:34:29 AEST 1990


In article <6193:Dec618:43:4390 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
>#include <sys/types.h>
>#include <sys/stat.h>
>
>main()
>{
> struct stat st;
>
> fstat(0,&st);
> printf("size on disk (not including holes) %ld\n",st.st_blocks);
>}

% grep st_blocks /usr/include/sys/stat.h
%

hmmm.  BSD feature?

how about "no PORTABLE way" to determine the size of a file on disk?
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh at rpp386.cactus.org



More information about the Comp.unix.internals mailing list