Solved

File Manipulation

Posted on 2004-09-29
3
176 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
  • 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
micro services spring boot application error 3 199
custom annotations 9 39
javap bin 2 36
Is Applet the way to go for my drag and drop system? 8 17
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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.

831 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