Just adding to all the other, useful replies: If for some reason you
insist on intercepting open/read you can also do this with LD_PRELOAD,
outside the kernel. Examples on how to do this can be found by searching
freshmeat.net for ld_preload (it has 14 projects, most of them seem to
be very similar to what you want).
Of course, writing a shell script that will run 'patch' is much easier,
but we probably do not fully understand your needs.
-- 
Didi

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.
> 
> 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.
> 
> 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.
> 
>  
> 
> 1. Do you think it is possible - The first solution ?
> 
> 2. Do you know of any existing solution ?
> 
> 3. Please share your ideas.
> 
>  
> 
> Thanks
> 
> Oren Honen
> 
> 
> 
>  +++++++++++++++++++++++++++++++++++++++++++
>  This Mail Was Scanned By Mail-seCure System
>  at the Tel-Aviv University CC.

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to