Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class LogMonitor
- {
- public static void main(String[] args) throws Exception
- {
- FileReader fr = new FileReader("D:/test.txt");
- BufferedReader br = new BufferedReader(fr);
- while (true)
- {
- String line = br.readLine();
- if (line == null)
- {
- Thread.sleep(1*1000);
- }
- else
- {
- byte[] y = line.getBytes();
- File g = new File("D:/abc.txt");
- OutputStream f = new FileOutputStream(g);
- f.write( y );
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement