Displaying 1 result from an estimated 1 matches for "sparse2".
Did you mean:
sparse
2005 Nov 09
1
smarter sparse files?
...e: On a file system supporting sparse files, the following
fd = open("sparse1",w");
write(fd, buf, 10);
lseek(fd,1000000,SEEK_CUR);
write(fd, buf, 10);
will create a file occupying a small number of
disk blocks. Ideally I would like to be able to do
the following
fd = open("sparse2",w");
write(fd, buf, 1000020);
lseek(fd,10,SEEK_SET);
giveback(fd, 1000000, SEEK_CUR);
lseek(fd,1000010,SEEK_SET);
write(fd, buf, 10);
and end up with a sparse2 not much larger than
sparse1. "giveback" is my imaginary system call
that tells the file system that n bytes star...