The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: george999 on September 21, 2007, 10:57:19 PM

Title: Mp3 files
Post by: george999 on September 21, 2007, 10:57:19 PM
I want to make a program that search entire HDD and when find two mp3 files with the same size to delete one of it.I am using Masm32+RadAsm.Any ideeas to start from?

PS: Sorry for my English.
Title: Re: Mp3 files
Post by: dsouza123 on September 21, 2007, 11:31:01 PM
Hopefully the same sized files have the same contents or you have just lost a file.

What your describing is removing duplicate files.

Looking at just at file size or file names can be misleading,
the file size along with the content (the values of the bytes) in the files
will give better results.

Code you will need:
Directory traversal.
Saving file information in some appropriate data structure for files that match your criteria.
(Optional) When done sort the file information by size.
Compare the contents of files with matching file size.
On exact matches delete one of them,
you could ask for user input in the choice or even whether to skip deletion.
Title: **
Post by: george999 on September 22, 2007, 10:31:11 PM
Thank you!
But what functions should I use ?
Title: Re: Mp3 files
Post by: dsouza123 on September 22, 2007, 11:04:46 PM
For the first item, directory traversal (directory recursion)
the following thread has code snippets and working examples.

http://www.masm32.com/board/index.php?topic=5844.0

Searching the forums mostly the Campus, Workshop and Laboratory
should give you alot to work with.