lkml.org 
[lkml]   [2001]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Editing-in-place of a large file
On Sun, Sep 02, 2001 at 03:21:37PM -0500, Bob McElrath wrote:
> I would like to take an extremely large file (multi-gigabyte) and edit
> it by removing a chunk out of the middle. This is easy enough by
> reading in the entire file and spitting it back out again, but it's
> hardly efficent to read in an 8GB file just to remove a 100MB segment.
>
> Is there another way to do this?

It's basically changing ownership (in terms of "which inode owns
which blocks") of blocks.

There is just no POSIX-API to do this, that's why there is no
simple way to do this.

Applications handling such large files usally implement a chunk
management, which can mark chunks as "unused" and skip them while
processing the file.

What's needed is a generalisation of sparse files and truncate().
They both handle similar problems.

For now I would seriously consider editing the ext2-structures
for this, because that's the only way you can do this right now.

Regards

Ingo Oeser
--
In der Wunschphantasie vieler Mann-Typen [ist die Frau] unsigned und
operatorvertraeglich. --- Dietz Proepper in dasr
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:01    [W:0.123 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site