Re: file changes monitor

2005-12-13 Thread Jenny Chen
Please check on this link: http://www.oreilly.com/catalog/cookbook/chapter/ch08.html Jenny --- Octavian Rasnita <[EMAIL PROTECTED]> wrote: > From: "Mulander" <[EMAIL PROTECTED]> > Hi again, > I did some testing on the method I meantioned before > here is the code: > > Thank you for the code. I

Re: file changes monitor

2005-12-13 Thread Octavian Rasnita
From: "Mulander" <[EMAIL PROTECTED]> Hi again, I did some testing on the method I meantioned before here is the code: Thank you for the code. I will try to do it again. I will try to find how File::Tail does that blocking, because my problem is that this program should run continuously, and if I u

Re: file changes monitor

2005-12-13 Thread Octavian Rasnita
From: "Mulander" <[EMAIL PROTECTED]> Hi, In your situation I would try doing something like: a) Check the size of the local file ** My program does that. b) connect to the remote computer c) check the size of the remote file ** Yes, I am doing that. d) if local and remote file sizes do not ma

Re: file changes monitor

2005-12-13 Thread Mulander
Hi again, I did some testing on the method I meantioned before here is the code: #!/usr/bin/perl use warnings; use strict; my $a = 'a.txt'; my $b = 'b.txt'; if(-s $a != -s $b){ print "Files differ\n"; open F1,">>$a" or die "Can't open: $!"; open F2,"<$b" or die "Can't open: $!"; seek F2,-s $a

RE: file changes monitor

2005-12-13 Thread Timothy Johnson
What operating system are you on? For Win32, check out the Win32::ChangeNotify module. -Original Message- From: Octavian Rasnita [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 13, 2005 9:46 AM To: beginners@perl.org Subject: file changes monitor Hi, I have created a program that m

Re: file changes monitor

2005-12-13 Thread Mulander
Hi, In your situation I would try doing something like: a) Check the size of the local file b) connect to the remote computer c) check the size of the remote file d) if local and remote file sizes do not match then I would use seek to jump to offset where my file ends. e) read in the changes and a

Re: file changes monitor

2005-12-13 Thread JupiterHost.Net
Octavian Rasnita wrote: Hi, I have created a program that monitors a text file which sits on another Why not use File::Tail or File::Tail::App or some other File::Tail:: mod? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]