title: Shrinking a file in C
body: <p>How does one shrink a file in C?  For example, if I open a 2mb file, do some work and decide only 1mb of the file should still exist, how is this accomplished?  I know how to use write( fd,....) to write to a file, but what if I want to carve out certain parts in the middle of a file or truncate it?</p>