Solved

File Manipulation

Posted on 2004-09-29
3
174 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
Comment Utility
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
Comment Utility
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
Comment Utility
I guess you got one of those to work? Cool. Thanks for the points.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

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 second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
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.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now