Re: tool to turn redundant files into symlinks

2007-05-22 Thread Wesley J. Landaker
On Monday 21 May 2007 23:51:24 Klaus Ethgen wrote:
> Hi Weskey,
>
> Am Di den 22. Mai 2007 um  0:53 schrieb Wesley J. Landaker:
> > > If hardlinks are okay too, see the "perforate" package (I find this
> > > package hard to find, since the name is somewhat misleading). It's
> > > written in Perl.
> >
> > Well, thanks, I didn't know about this one. But, it does really *have*
> > to be symlinks. I've found a few other tools that do hardlinks. =)
>
> I am the author of perforate. Well I rewritten it from scratch as the
> original tool had some flaws.
>
> It is very easy to add a option for symlinking. But there is a little
> problem deciding which of the files should be the symlink and which the
> original. With hardlinks this is not the problem as after hardlinking
> the files together there is no different between them.

In my case, it could be arbitrary and it would be fine. But it might be a 
good idea to always sort by directory hierarchy (i.e. always either prefer 
to symlink either up or down a directory tree).

> > Anyway, if there isn't something that already does it, I can probably
> > just parse the output of one of these programs and do the symlink
> > replacement myself.
>
> That would be the other way. finddup can print out the double files.

One issue I have with both finddup and fdupes, is they both don't quote 
their output very sanely; or at least, in not in a particularly easy manner 
for parsing (I can do it with a lookbehind regex).

For example:
$ finddup .
2 './file with spaces' './file1' './file with (parens)' './file with a
newline' './file2' './file with 'ticks'' './file with "quotes"'
$ fdupes -1 .
./file1 ./file\ with\ a
newline ./file\ with\ "quotes" ./file\ with\ 'ticks' ./file\ with\ 
(parens) ./file\ with\ spaces ./file2

I would LOVE it if it would shell quote the output or something... or if 
there was a -0 option to delimit things with nulls... or something that 
could make it work reliably with any filename

Anyway, sounds like maybe I should file some wishlist bugs. =)

-- 
Wesley J. Landaker <[EMAIL PROTECTED]> 
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2


signature.asc
Description: This is a digitally signed message part.


Re: tool to turn redundant files into symlinks

2007-05-21 Thread Klaus Ethgen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Weskey,

Am Di den 22. Mai 2007 um  0:53 schrieb Wesley J. Landaker:
> > If hardlinks are okay too, see the "perforate" package (I find this
> > package hard to find, since the name is somewhat misleading). It's
> > written in Perl.
> 
> Well, thanks, I didn't know about this one. But, it does really *have* to be 
> symlinks. I've found a few other tools that do hardlinks. =)

I am the author of perforate. Well I rewritten it from scratch as the
original tool had some flaws.

It is very easy to add a option for symlinking. But there is a little
problem deciding which of the files should be the symlink and which the
original. With hardlinks this is not the problem as after hardlinking
the files together there is no different between them.

> Anyway, if there isn't something that already does it, I can probably just 
> parse the output of one of these programs and do the symlink replacement 
> myself.

That would be the other way. finddup can print out the double files.

Gruß
   Klaus
- -- 
Klaus Ethgenhttp://www.ethgen.de/
pub  2048R/D1A4EDE5 2000-02-26 Klaus Ethgen <[EMAIL PROTECTED]>
Fingerprint: D7 67 71 C4 99 A6 D4 FE  EA 40 30 57 3C 88 26 2B
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iQEVAwUBRlKE3J+OKpjRpO3lAQJlawf+OGyqWgsq3RzGdaSIxrDwJVgeSi7zIr3M
qw7rUHBfdpwncIxj34caKgTtuuTzbGZSWejwfwF0+k3lz3S7OjSCEJEf+AULUmCj
6YQuW/5G27vukx2y164V2oJ74GO9GHFxCELN8c9Rjv7+wx6AbPSGBeFe+FR3AtSz
Ibo1bzdtWfOBkz5Grd68BOI3y0kv6du7JwMlBhX70aPVv8VsPfo8pqewViva1xBs
S9xXTMwrmiIDJnLP0PrYiG+ihCBJqw4ucOaGmcKfXi9xvTVvnteaJn0FmVknCxX2
KCRHhkOjkE+fFKMHmXDvBoRutnRBH70erw5FSI8NOPSGsRewLMW56Q==
=HQQ2
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: tool to turn redundant files into symlinks

2007-05-21 Thread Wesley J. Landaker
On Monday 21 May 2007 00:16:13 Philipp Matthias Hahn wrote:
> On Sun, May 20, 2007 at 07:42:56PM -0600, Wesley J. Landaker wrote:
> > For a package problem I'm trying to solve (#414422), it would be nice
> > to have a tool that could find duplicate files (ala fslint[1] or
> > fdupes[2]) and turn them into symlinks.
>
> If hardlinks are okay too, see the "perforate" package (I find this
> package hard to find, since the name is somewhat misleading). It's
> written in Perl.

Well, thanks, I didn't know about this one. But, it does really *have* to be 
symlinks. I've found a few other tools that do hardlinks. =)

Anyway, if there isn't something that already does it, I can probably just 
parse the output of one of these programs and do the symlink replacement 
myself.

-- 
Wesley J. Landaker <[EMAIL PROTECTED]> 
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2


pgpOQAWHtYT3d.pgp
Description: PGP signature


Re: tool to turn redundant files into symlinks

2007-05-20 Thread Philipp Matthias Hahn
On Sun, May 20, 2007 at 07:42:56PM -0600, Wesley J. Landaker wrote:
> For a package problem I'm trying to solve (#414422), it would be nice to 
> have a tool that could find duplicate files (ala fslint[1] or fdupes[2]) 
> and turn them into symlinks.

If hardlinks are okay too, see the "perforate" package (I find this
package hard to find, since the name is somewhat misleading). It's
written in Perl.

$ dlocate /usr/bin/finddup
perforate: /usr/bin/finddup

$ whatis finddup
finddup (1)  - Find identical files and do something with them

$ finddup --help
Usage:
finddup [options...]

 --man  the manpage
 -h, --help a short help
 --version  the version (CVS) of the program
 -n, --noaction do just nothing, just print out (implies -v)
 -v, --verbose  just what the name says
 -q, --quietbe quiet
 -l, --link link the identical files together
 -o, --oldresultUse the old output of this script
 -i, --ignore-perms Don't check that file owner and permissions match
 -d, --dir  Define the dir to check (you may specify more than 
one)

BYtE
Philipp
-- 
Philipp Matthias Hahn <[EMAIL PROTECTED]>
 GPG/PGP: 9A540E39 @ keyrings.debian.org


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]