Hi.

The program I am writing is for a mac and am doing so in Java.
I am writing a program that finds Identical files or very similar files, not necessarily identical but very Similar. Now I can thus far compare files by name but some files are identical but have different names. Are there any other ways to compare files other than name, size is not really ideal nor is date created or modified as these can be different yet the files are identical.

Thank you in advance

You could compare the bytes you get from reading the file, but I have never used that way and I don't know how it will work.

As far as the almost identical you will need to decide the ruling.

http://java.sun.com/javase/6/docs/api/java/io/BufferedInputStream.html

http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html

http://java.sun.com/javase/6/docs/api/java/io/ByteArrayInputStream.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.