All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ninel Evol" <myLC@gmx.net>
To: linux-ext4@vger.kernel.org
Subject: inserting/deleting into/from the middle of large files?
Date: Sun, 08 Jul 2007 15:13:31 +0200	[thread overview]
Message-ID: <20070708131331.212980@gmx.net> (raw)


'lo there, =)

having a DVB-S receiver running Linux (PPC) I found myself 
wondering how to delete data from the middle of a large file 
(stripping a recording of ads, for example - or messing 
around in a virtual disk file, etc.). Currently, the common 
way of doing this seems to be by copying the file (leaving a 
part behind) and then deleting the original. Of course, on a 
large file (say 12 GB) this can take an eternity; also you 
can run into trouble if the filesystem is nearly full...

Is it me, or doesn't that make any sense?
Having a block-oriented filesystem, operations like this 
should only take an instance.

So basically I'm looking for functions to:
- insert a chunk into a file
- delete a chunk from a file
- move a chunk from one file into another

All of the above would be very useful when dealing with 
large data, such as DVB-recordings (Linux being the nr.1 OS 
on those receivers, naturally:-).

Seeing a large file as a chain of blocks, making such an 
operation on a block-sized basis should already be easy to 
accomplish. However, if you want full support there should 
be the possibility to insert "sparse blocks" (less content 
than the usual) within a chain of blocks (including the 
beginning).

Is this already possible?
Would it be difficult to implement?

Think about it: instead of copying gigabytes with the 
drive's heads clicking around - taking minutes to hours, 
such operations could be performed in (milli)seconds.

I think that there should indeed be a standard (Posix?) for 
providing such functionality. (One call could be to 
determine if the filesystem supports those operations fast -
it could return a version for instance, 0 meaning that the 
operations, although provided, will be slow.)

What is needed in the first place however, is a filesystem 
supporting those operations - making it first choice for 
VDRs running Linux. (The others would surely follow soon 
after, at which point there should be the chance for 
establishing a standard.)


Looking forward for some enlightenment... :-)

                                           LC (myLC@gmx.net)


-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

                 reply	other threads:[~2007-07-08 13:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070708131331.212980@gmx.net \
    --to=mylc@gmx.net \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.