Mail Archives: djgpp-workers/2000/03/06/22:14:40
>
>
> On Sun, 5 Mar 2000, Alain Magloire wrote:
>
> > The Daemon thing is another step nothing special about it, you start a cron
> > job or any shell scripts.
>
> Running a program in background is easy, but finding files that are
> identical (efficiently) is not.
find $1 -xdev -type f -printf '%p %s\n' | \
sort -nk1 | tee candidates | \
uniq -f1 >uniquefiles && \
comm -3 candidates uniquefiles >redundant && \
join -1 2 -2 2 -o 2.1 1.1 redundant uniquefiles | xargs -n2 ln -f
This was proposed by a coworker here. I did not try it, but it's just a proof
that this is something that sh/awk/perl gurus can probably come up with in
one afternoon.
> > > But you'd also need something like copy-on-write to deal with one of the
> > > files being modified, if you wanted it to be transparent.
> >
> > Why do you want COW (Copy On Write)? I would expect any modifications
> > to be reflected on all the files.
>
> I think you forget that the links were not created by the user, they
> were created by a program which didn't have any clue whether the user
> did or didn't want these files to be linked. Since the user didn't
> link the files, she might be mightily surprised when changing one of
> them changes the other(s) as well.
Agreed. Nate also remind me of this.
>
> For example, imagine that you have 5 different versions of the Grep
> distribution on your disk ;-). Suppose that the ``link daemon'' finds
8-) [laughs] actually I just finish the count and I have 6 lying around.
> out that all 5 versions have the same dfa.c in them, and decides to
> link them together. Then you modify dfa.c in one of the directories.
> Then you want to diff it against the old version, to send diffs to
> your pretesters. Imagine your surprise when Diff reports identical
> files...
How shocking !! ;-)
Agreed, on the example.
We have the same thing here, it is call the filesystem package
and not the "Single Instance Store" and I've been using it for quite
sometimes on QNX/Neutrino.
--
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!
- Raw text -