?
Solved

File Manipulation

Posted on 2004-09-29
3
Medium Priority
?
181 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 1000 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

770 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