Re: Is there a "make hole" (truncate in middle) syscall?

From: Peter Chubb
Date: Thu Dec 04 2003 - 17:56:50 EST

>>>>> "Rob" == Rob Landley <rob@xxxxxxxxxxx> writes:

Rob> You can make a file with a hole by seeking past it and never
Rob> writing to that bit, but is there any way to punch a hole in a
Rob> file after the fact? (I mean other with lseek and write. Having
Rob> a sparse file as the result....)

SVr4 has fcntl(fd, F_FREESP, flock) that frees the space covered by
the struct flock in the file. Linux doesn't have this, at least in
the baseline kernels.

Dr Peter Chubb peterc AT
The technical we do immediately, the political takes *forever*
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at