Sparse Files ?

David Goodenough dg at lakart.UUCP
Wed May 3 02:01:03 AEST 1989


madd at bu-cs.BU.EDU (Jim Frost) sez:
] mark at ria-emh2.army.mil (Mark D. McKamey IM SA) writes:
] |     What is the definition of a "Sparse file" in the UNIX world?
] 
] UNIX stores data in files by maintaining pointers to data blocks.  By
] allocating only those blocks which have actually been written to, you
] can create files which appear to be larger than they actually are.
] These are usually created by lseek()ing and write()ing.
] 
] When you create an empty file, the system allocates a file information
] block (called an inode) which contains a small list of block pointers.
] This list is initially blank.  When we write into the file, the system
] gets data blocks and sets the appropriate block pointer to point to
] the block.

Hummm - this sounds a bit like CP/M - obviously UNIX stuffs a lot more info
into the inode than CP/M does into it's directory slot, but the method of
a list of block numbers is exactly the same. Now for the $64000 question:
what does UNIX do when it runs out of block number slots in the inode. I
doubt it's the same as CP/M (which just allocates a second directory entry
for the file, and sets a flag to show this is an extension). So how does
UNIX handle very big files?
-- 
	dg at lakart.UUCP - David Goodenough		+---+
						IHS	| +-+-+
	....... !harvard!xait!lakart!dg			+-+-+ |
AKA:	dg%lakart.uucp at xait.xerox.com		  	  +---+



More information about the Comp.unix.questions mailing list