Hello Everybody, I have to build a tool for Direcotry/File comparison ( ASCII, TEXT, BYTE ) any format. I am thinking of building with Java for platform independence. So does anybody have any idea how should I proceed. I have to be really quick. It would be really nice to start with inputs from Java gurus. Thanks, Nanu
Not a very hard thing to do. You'll make heavy use of the java.io.File class, so go off and read the whole API page for it. File is what you'll use to find out if something is a directory and to list a directory. The first thing to do is probably to sit down and write down exactly what the program's interface should be like, and what exactly it should do in various situations. From your brief problem description here, there are many different ways you could go.
Hi Ernest, I have to develop commandline interface for this tool, which will take care of all the forms of file I mentioned in my previous post disregarding the time stamp. Also, I have one question, can we convert TEXT file to byte code with java for the comparison purpose? I am new to this tool and never used one, so if you can provide me with little more description of the ways I can opt for it will be really nice. Thanks, Nanu
Here's the doc for something I did in Pascal, first version in DOS about 1987, last version with a nifty GUI. It compares directories and files by timestamps. Comparing files by content would be an interesting addition. See if it gives you any ideas. I'd be happy to talk about the algorithms.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Given such a requirement (which may be bogus), I would be focusing on what I believe is the most difficult part: creating an algorithm that determines the type of the file given the file's attributes. Some questions that I'd first answer: Is it a text file if it contains only printable characters ? What exactly is a printable character ? etc. etc. Using the core API to do the rest is relatively trivial.