From: "J." <mailing-lists@xs4all.nl>
To: linux-c-programming@vger.kernel.org
Subject: Re: file deletion
Date: Mon, 27 Dec 2004 04:50:15 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.21.0412270410050.3874-100000@hestia> (raw)
In-Reply-To: <003f01c4e9ba$7679d020$316c4ed5@j0s6l8>
On Fri, 24 Dec 2004, Andy wrote:
> Does anybody know of any useful code or c commands that
> you can use to search for duplicate files within a linux/unix directory and
> its subdirectories and remove them?
> Thanks
> Andrew
Ehm.. Personally no.. However there is ftw, opendir, readdir, stat,
fstat... etc.. Ones you are able to access all the directory entries you
have to make a decision how you want to compare e.g. md5, crc32, only size
or name etc... Then there is the issue of choosing a optimal ADT and
access/retrieval algo.
If you dont have to c code the program but just looking for a solution I
would most certainly go for a:
`find -type f -exec md5sum '{}' \; >> md5.log`
and parse the md5.log with a simple shell or awk script. That would save
many headache's.. Plus you don't have to reinvent `find`...
J.
--
http://www.rdrs.net
next prev parent reply other threads:[~2004-12-27 3:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-23 13:14 Thread scheduling on an SMP Darío Mariani
2004-12-23 17:08 ` Richard Nairn
2004-12-24 13:14 ` file deletion Andy
2004-12-23 13:49 ` Jan-Benedict Glaw
2004-12-27 3:50 ` J. [this message]
2004-12-30 11:26 ` Glynn Clements
2004-12-30 12:04 ` wwp
2005-01-01 11:09 ` Andy
2004-12-31 17:55 ` Jan-Benedict Glaw
2005-01-06 7:07 ` Linux source code: malloc.c Venkatesh Joshi
2005-01-06 9:11 ` Steven Smith
2005-01-06 15:27 ` davidgn
2005-01-06 16:10 ` Steven Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.21.0412270410050.3874-100000@hestia \
--to=mailing-lists@xs4all.nl \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).