Solved

File Manipulation

Posted on 2004-09-29
3
180 Views
Last Modified: 2010-03-31
OK,

I've written a program and here is what it does:

1. Every 3 seconds, the prog checks to see if a files lastModified time has changed.  
2. If it has, the prog then reads each line (the line is a list of parameters for another class)
3. Launches another class in a new thread for each line and processes the parameters
4. deletes the original file (after all lines have been read and the InputStreamReader is closed)
5. recreates the file for future entries (because I don't want to re-process those lines already processed).
6. sets the new files lastModified time to the last captured lastModified time

The future entries will be written to the file using asp.

Is there a better way of doing this???  If you would like to see my code, please let me know.  It's quite lengthy.  If there is a better way of doing this, examples or links to examples would be great.

Thanks

DDS
0
Comment
Question by:dds110
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
TrekkyLeaper earned 250 total points
ID: 12186669
I can't really give you any examples, but I do have a couple suggestions.

1) You might want to consider using network sockets feed the ASP output into the java program. Then you just use a buffered reader (or similar) to read lines from the socket.

2) If possible, you could pipe the output of the ASP file into stdin for the Java program. This would be similar to 1 except that you'd be using System.in instead of an input stream from the socket.
0
 
LVL 8

Author Comment

by:dds110
ID: 12190087
Sounds interesting.  I think I'll give it a go.  But I want to see if anyone else chimes in before I award points.
0
 
LVL 5

Expert Comment

by:TrekkyLeaper
ID: 12199573
I guess you got one of those to work? Cool. Thanks for the points.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question