[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] in place option for unexpand

From: Sami Kerola
Subject: Re: [PATCH] in place option for unexpand
Date: Fri, 27 Mar 2009 14:20:59 +0100

2009/3/27 Pádraig Brady <address@hidden>:

> Sami Kerola wrote:
>> Mean while I've continued with a first patch. I am having a hard time
>> with cp_option_init. My source file is created by mkstemp which causes
>> permissions to be 600. What ever I do with preserve permissions bits I
>> always seem to get source file permissions in place. Am I such an
>> amateur that I am not seeing something obvious, or is it really so
>> that there is no preserve destination permissions?
> I'm a little confused by what you mean by mkstemp here.
> As a first step to support an `in-place cmd files` shell script,
> you would need a cp --attributes-only option which should
> do what cp does now but not do any read() or write() any data.
> That would be generally useful option anyway outside of
> an in place editing stuff.

Well I changed rename to copy that is part of coreutils and use the
call in move_mode. I did not send new patch because I want to be sure
my employer has signed papers stating that they have no right to my
contributions to coreutils. Perhaps I should wait copyright papers to
get ready before making questions. It's a bit difficult to ask
questions && get correct answers when you don't see what I am talking

>> 1. grep /etc/hosts |
>> writeafter /etc/hosts
> That interface seems useful, but note the `sponge` command
> from moreutils which I just remembered after your example.
> Note sponge can rename() and loose some attributes from
> a quick glance at the code.

ACK. After writing good --in-place patch(es) for coreutils I might
contribute to moreutils.

>> 2. echo /etc/passwd /etc/shadow |
>> writeafter -I '{}' grep root '{}'
>> Does that sound like something reasonable? If yes, it might take a
>> while to come up with a well working implementation but I'm sure
>> that's doable.
> that seems a little over complicated as I can't see one
> needing to split files to edit and files to process on
> position like that.

You might be right. If there is ones in life time usage for that one
should use sponge in for loop.

   Sami Kerola

reply via email to

[Prev in Thread] Current Thread [Next in Thread]