News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Mp3 files

Started by george999, September 21, 2007, 10:57:19 PM

Previous topic - Next topic

george999

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.

dsouza123

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.

george999

Thank you!
But what functions should I use ?

dsouza123

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.