From: Honen, Oren (oren.honen_at_nonexisting.hamakor.org.il)
Date: Sun 02 May 2004 - 14:11:27 IDT
Thanks, but...
>Subject: Re: Huge file patches
>
>On Sun, May 02, 2004 at 01:18:42PM +0300, Honen, Oren wrote:
>> Hi all,
>>
>> I have a huge ASCII file ( 500M ) in a release I have. I need to
patch
>> this file in several different ways for each release.
>>
>> These files are then being read by a commercial application.
>>
>> Currently we just create several copies and patch each of them
>> differently. The changes are several lines only.
>>
>> I'm thinking of writing an application that will create a dummy file.
>> When this file is read the application will return a data based on
the
>> original file and a diff file. I thought of using /proc fs for that
so
>> when reading this file, a callback routine will be activated.
>
>Rule of thumb: don't do unnecedsary things in kernel-space. Try a
>userspace solution first.
>
As I said, this file is meant to be read by a commercial application. I
can not touch this application so I need my new file to look & feel as a
real ascii file. This file is supplied via a parameter and not as stdin
redirection.
>>
>> As far as I looked this is possible but only with kmodule and/or
device
>> driver ( and using /dev ). The problem is that I need all of this in
>> user space with NO root privilegese.
>
>This is not anything more efficient that using patch (or a custom
>program).
>
>For starters you can use a script such as:
>
>cat >mypatch <<EOF
>#!/bin/sh
>
>HUGE_FILE=/path/to/huge_file
>patch <$HUGE_FILE $1
>EOF
>
>And run 'mypatch custom.diff'
>
>custom.diff should be in a unified diff format (output of diff -u). It
>is simple and quite easy to follow. You can easily write one or modify
>one if the change is simple.
>
>Other options: sed/'perl -p'/ex/ed for inline editing.
>
>(diff actually has an output format of a diff script. Meybe it will
turn
>out as a simpler way of describing the changes.
>
>
>I figure that the above methods are simpler than writing your own text
>patcher in C.
>
>
>For non-text file patches you should be able to use xdelta. But I have
>never tried it.
>
>>
>> Other solution might be massing with i-node with some parts pointing
to
>> the original file and other parts pointing at fixed lines files. I
>> believe this solution is worst as it involves to much hacking.
>
>Sounds real bad: you assume here you know the exact details of the
>underlying file system. Very dangerous.
>
>--
>Tzafrir Cohen +---------------------------+
>http://www.technion.ac.il/~tzafrir/ |vim is a mutt's best friend|
>mailto:tzafrir_at_technion.ac.il +---------------------------+
>
>=================================================================
>To unsubscribe, send mail to linux-il-request_at_linux.org.il with
>the word "unsubscribe" in the message body, e.g., run the command
>echo unsubscribe | mail linux-il-request_at_linux.org.il
================================To unsubscribe, send mail to linux-il-request_at_linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request_at_linux.org.il
This archive was generated by hypermail 2.1.7 : Sun 02 May 2004 - 14:25:59 IDT