java/c++: question on functionality

Status
You're currently viewing only OneFootsTheSame's posts. Click here to go back to viewing the entire thread.
Not open for further replies.

OneFootsTheSame

Smack-Fu Master, in training
70
In case you're still thinking Applets ... DONT! Doing this server side will be easier. (Do people still write Applets? ;) )

Managing the text files with Java won't be difficult for you once you find all the APIs. One way to read the file is to do something like this:

code:<HR>
Code:
BufferedReader in = null;
try
{
    in = new BufferedReader(new FileReader("YourFileName"));
    String tmpLine = null;
    while ((tmpLine = in.readLine()) != null) {}
}

After you've added or removed your entry from the data, you can then run your C++ prog and send the output back to the client.

Of course you will have to be able to indicate which items to delte and gather data for new items. Not that it's hard, but it can be time consuming (at least for me ... but, I get anal about my interfaces).
 

OneFootsTheSame

Smack-Fu Master, in training
70
in class the whole thing will run on one machine

Will you be able to set up the machine before having to compile and run in on the spot? If not, this will be difficult. Getting the environment setup should mostly a matter of running installers. On my dev machine I install: Java, then JSDK (add jsdk.jar to CLASSPATH env var), then Apache, then JServ, and it all pretty much works. But I'm behind the times and really would rather be using Tomcat (can't just yet) which is what I recommend to you. Once installed, find the sample servlets and start working from there. The default configuration should be good enough for your purposes. Then, rip off the IsItWorking servlet to get a basic servlet framework.

Java file IO sucks, ... I'd use Perl

Perl for file/text processing is teh win! However, reading things like s/^\s*(.*?)\s*$/$1/ makes my head hurt. :)
 
Status
You're currently viewing only OneFootsTheSame's posts. Click here to go back to viewing the entire thread.
Not open for further replies.