Skip Menu |

This queue is for tickets about the File-Tail-Dir CPAN distribution.

Report information
The Basics
Id: 80457
Status: resolved
Priority: 0/
Queue: File-Tail-Dir

People
Owner: Nobody in particular
Requestors: danny.blazejczak [...] dimensiondata.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Error with .filetaildirwatchdog on windows
Date: Mon, 29 Oct 2012 11:21:47 +1100
To: "bug-File-Tail-Dir [...] rt.cpan.org" <bug-File-Tail-Dir [...] rt.cpan.org>
From: "Danny Blazejczak (AU)" <danny.blazejczak [...] dimensiondata.com>
Hi Jon, Thanks as well for this File::Tail::Dir module. It seems to do exactly what I need. I am testing this module at the moment on Windows 7 - SP1. The '_start_watchdog' is causing problems on this OS though, when saving state. Maybe this functionality is not intended to work on Windows? Perl version = v5.16.1 built for MSWin32-x86-multi-thread Module version = File-Tail-Dir-0.12 When saving state I have this error: Uncaught exception from user code: C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirwatchdog: No such file or directory at C:/perl/perl/site/lib/File/Tail/Dir.pm line 454. Cwd::_croak('C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirw...') called at C:/perl/perl/lib/Cwd.pm line 630 Cwd::fast_abs_path('C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirw...') called at C:/perl/perl/site/lib/File/Tail/Dir.pm line 454 File::Tail::Dir::_start_watchdog('File::Tail::Dir=HASH(0x2cf561c)') called at C:/perl/perl/site/lib/File/Tail/Dir.pm line 411 File::Tail::Dir::watch_files('File::Tail::Dir=HASH(0x2cf561c)') called at multitail.pl line 45 When looking at the code, in File::Tail::Dir.pm , line 454: my $filename = abs_path(File::Spec->catfile($self->private_dir, $_dotfile)); the abs_path function checks if the file exists (Cwd:: fast_abs_path - line 630). The file (.filetaildirw ) does not exist yet at this point, and hence the failure. As a workaround, I created this file at the start of my script. In this scenario the script goes a bit further, but fails at '$SIG{USR1}', which is a Unix signal, not recognized on Windows: No such signal: SIGUSR1 at C:/perl/perl/site/lib/File/Tail/Dir.pm line 472, <__ANONIO__> line 12 (#1) (W signal) You specified a signal name as a subscript to %SIG that was not recognized. Say kill -l in your shell to see the valid signal names on your system. I think I use the module correctly, as follows: my @_DIRECTORIES = ['C:/projects/1/','C:/projects/2/']; my $tailer = File::Tail::Dir->new( directories => @_DIRECTORIES, filter => qr/.*log$/, autostate => 1, # 0 - 0=update for every change. (value in sec) # does not seem to work (no .filetaildirstate) - but no error # 1 - error ".filetaildirwatchdog: No such file or directory" autostate_delay => 1, ); $tailer->watch_files(); When I set the 'autostate_delay => 0', I do not get the error, but also the state file is not saved. Maybe there is something else I am missing? Thanks for any help with this, Danny
Subject: Re: [rt.cpan.org #80457] Error with .filetaildirwatchdog on windows
Date: Mon, 29 Oct 2012 11:35:46 +1030
To: bug-File-Tail-Dir [...] rt.cpan.org
From: Jon Schutz <jon.schutz [...] youramigo.com>
Hi Danny, I don't have a test environment set up on Windows so I'll need your assistance to fix... Re the second issue, if you change SIGUSR1 to another signal (sounds like SIGINT might be the best choice for windows), does that solve the problem? If so I can allow the signal to be user-specified. Re the first issue, I will look into it properly when I have a moment. Regards, -- Jon Schutz CTO, YourAmigo Ltd 53 Gilbert St Adelaide SA 5000 Ph: +61 8 82119211 Fax: +61 8 8211 6356 http://www.youramigo.com On 29/10/12 10:52, Danny Blazejczak via RT wrote: Show quoted text
> Sun Oct 28 20:22:13 2012: Request 80457 was acted upon. > Transaction: Ticket created by danny.blazejczak@dimensiondata.com > Queue: File-Tail-Dir > Subject: Error with .filetaildirwatchdog on windows > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: danny.blazejczak@dimensiondata.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80457 > > > > Hi Jon, > > Thanks as well for this File::Tail::Dir module. It seems to do exactly what I need. > > I am testing this module at the moment on Windows 7 - SP1. The '_start_watchdog' is causing problems on this OS though, when saving state. Maybe this functionality is not intended to work on Windows? > Perl version = v5.16.1 built for MSWin32-x86-multi-thread > Module version = File-Tail-Dir-0.12 > > When saving state I have this error: > > Uncaught exception from user code: > C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirwatchdog: No such file or directory at C:/perl/perl/site/lib/File/Tail/Dir.pm line 454. > > Cwd::_croak('C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirw...') called at C:/perl/perl/lib/Cwd.pm line 630 > Cwd::fast_abs_path('C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirw...') called at C:/perl/perl/site/lib/File/Tail/Dir.pm line 454 > File::Tail::Dir::_start_watchdog('File::Tail::Dir=HASH(0x2cf561c)') called at C:/perl/perl/site/lib/File/Tail/Dir.pm line 411 > File::Tail::Dir::watch_files('File::Tail::Dir=HASH(0x2cf561c)') called at multitail.pl line 45 > > When looking at the code, in File::Tail::Dir.pm , line 454: > my $filename = abs_path(File::Spec->catfile($self->private_dir, $_dotfile)); > the abs_path function checks if the file exists (Cwd:: fast_abs_path - line 630). The file (.filetaildirw ) does not exist yet at this point, and hence the failure. > > As a workaround, I created this file at the start of my script. In this scenario the script goes a bit further, but fails at '$SIG{USR1}', which is a Unix signal, not recognized on Windows: > No such signal: SIGUSR1 at C:/perl/perl/site/lib/File/Tail/Dir.pm line 472, > <__ANONIO__> line 12 (#1) > (W signal) You specified a signal name as a subscript to %SIG that was > not recognized. Say kill -l in your shell to see the valid signal > names on your system. > > I think I use the module correctly, as follows: > my @_DIRECTORIES = ['C:/projects/1/','C:/projects/2/']; > my $tailer = File::Tail::Dir->new( > directories => @_DIRECTORIES, > filter => qr/.*log$/, > autostate => 1, > # 0 - 0=update for every change. (value in sec) > # does not seem to work (no .filetaildirstate) - but no error > # 1 - error ".filetaildirwatchdog: No such file or directory" > autostate_delay => 1, > ); > $tailer->watch_files(); > > When I set the 'autostate_delay => 0', I do not get the error, but also the state file is not saved. > > Maybe there is something else I am missing? > > Thanks for any help with this, > Danny >
Subject: RE: [rt.cpan.org #80457] Error with .filetaildirwatchdog on windows
Date: Mon, 29 Oct 2012 16:30:16 +1100
To: "bug-File-Tail-Dir [...] rt.cpan.org" <bug-File-Tail-Dir [...] rt.cpan.org>
From: "Danny Blazejczak (AU)" <danny.blazejczak [...] dimensiondata.com>
Hi Jon, Thanks for the quick response. Got the 2nd issue to work with following changes: Line 470 : $SIG{USR1} = sub { Change to : $SIG{INT} = sub { Line 500 : kill SIGUSR1, $pid; Change to : kill SIGINT, $pid; So this solves when the option (autostate_delay => 1) is set. The state is correctly updated in this case with the previous code changes. I also found that I could get around the 2nd issue by setting (autostate_delay => 0). Here again, the state is correctly updated. So, the workarounds by first creating the temp dir, and setting autostate_delay => 0 , would work with the current version. Here is my script, it may help someone in the mean time: #!/usr/bin/perl use strict; use warnings; use diagnostics; use File::Tail::Dir; use File::Basename; use Sys::Hostname; use POSIX qw/strftime/; use Cwd; # Workaround 1 : pre-create temp file. my $cwd = getcwd; my $tmpdir = $cwd . "/tmp/"; mkdir $tmpdir; open(FH,'>tmp/.filetaildirwatchdog') or die "Can't create file: $!"; close(FH); my $host = hostname; my @_DIRECTORIES = ['C:/projects/1/','C:/projects/2/']; my $tailer = File::Tail::Dir->new( directories => @_DIRECTORIES, filter => qr/.*log$/, private_dir => $tmpdir, autostate => 1, # 0 - 0=update for every change. (value in sec) # 1 - error ".filetaildirwatchdog: No such file or directory" autostate_delay => 0, ); #$tailer->save_state(); $tailer->watch_files(); Regards, Danny From: jon.schutz@youramigo.com via RT [mailto:bug-File-Tail-Dir@rt.cpan.org] Sent: Monday, 29 October 2012 12:06 PM To: Danny Blazejczak (AU) Subject: Re: [rt.cpan.org #80457] Error with .filetaildirwatchdog on windows <URL: https://rt.cpan.org/Ticket/Display.html?id=80457 > Hi Danny, I don't have a test environment set up on Windows so I'll need your assistance to fix... Re the second issue, if you change SIGUSR1 to another signal (sounds like SIGINT might be the best choice for windows), does that solve the problem? If so I can allow the signal to be user-specified. Re the first issue, I will look into it properly when I have a moment. Regards, -- Jon Schutz CTO, YourAmigo Ltd 53 Gilbert St Adelaide SA 5000 Ph: +61 8 82119211 Fax: +61 8 8211 6356 http://www.youramigo.com On 29/10/12 10:52, Danny Blazejczak via RT wrote: Show quoted text
> Sun Oct 28 20:22:13 2012: Request 80457 was acted upon. > Transaction: Ticket created by danny.blazejczak@dimensiondata.com<mailto:danny.blazejczak@dimensiondata.com> > Queue: File-Tail-Dir > Subject: Error with .filetaildirwatchdog on windows > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: danny.blazejczak@dimensiondata.com<mailto:danny.blazejczak@dimensiondata.com> > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80457 > > > > Hi Jon, > > Thanks as well for this File::Tail::Dir module. It seems to do exactly what I need. > > I am testing this module at the moment on Windows 7 - SP1. The '_start_watchdog' is causing problems on this OS though, when saving state. Maybe this functionality is not intended to work on Windows? > Perl version = v5.16.1 built for MSWin32-x86-multi-thread > Module version = File-Tail-Dir-0.12 > > When saving state I have this error: > > Uncaught exception from user code: > C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirwatchdog: No such file or directory at C:/perl/perl/site/lib/File/Tail/Dir.pm line 454. > > Cwd::_croak('C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirw...') called at C:/perl/perl/lib/Cwd.pm line 630 > Cwd::fast_abs_path('C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirw...') called at C:/perl/perl/site/lib/File/Tail/Dir.pm line 454 > File::Tail::Dir::_start_watchdog('File::Tail::Dir=HASH(0x2cf561c)') called at C:/perl/perl/site/lib/File/Tail/Dir.pm line 411 > File::Tail::Dir::watch_files('File::Tail::Dir=HASH(0x2cf561c)') called at multitail.pl line 45 > > When looking at the code, in File::Tail::Dir.pm , line 454: > my $filename = abs_path(File::Spec->catfile($self->private_dir, $_dotfile)); > the abs_path function checks if the file exists (Cwd:: fast_abs_path - line 630). The file (.filetaildirw ) does not exist yet at this point, and hence the failure. > > As a workaround, I created this file at the start of my script. In this scenario the script goes a bit further, but fails at '$SIG{USR1}', which is a Unix signal, not recognized on Windows: > No such signal: SIGUSR1 at C:/perl/perl/site/lib/File/Tail/Dir.pm line 472, > <__ANONIO__> line 12 (#1) > (W signal) You specified a signal name as a subscript to %SIG that was > not recognized. Say kill -l in your shell to see the valid signal > names on your system. > > I think I use the module correctly, as follows: > my @_DIRECTORIES = ['C:/projects/1/','C:/projects/2/']; > my $tailer = File::Tail::Dir->new( > directories => @_DIRECTORIES, > filter => qr/.*log$/, > autostate => 1, > # 0 - 0=update for every change. (value in sec) > # does not seem to work (no .filetaildirstate) - but no error > # 1 - error ".filetaildirwatchdog: No such file or directory" > autostate_delay => 1, > ); > $tailer->watch_files(); > > When I set the 'autostate_delay => 0', I do not get the error, but also the state file is not saved. > > Maybe there is something else I am missing? > > Thanks for any help with this, > Danny >
itevomcid

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #80457] Error with .filetaildirwatchdog on windows
Date: Fri, 02 Nov 2012 22:30:02 +1030
To: bug-File-Tail-Dir [...] rt.cpan.org
From: Jon Schutz <jon.schutz [...] youramigo.com>
Hi Danny, I have put in some fixes for Windows. SIGINT will be automatically selected if on Windows, or you can specify the signal to use using watchdog_signal_name. Only signals available on the current OS are allowed. The watchdog file is created before calling abs_path. Regards, -- Jon Schutz CTO, YourAmigo Ltd 53 Gilbert St Adelaide SA 5000 Ph: +61 8 82119211 Fax: +61 8 8211 6356 http://www.youramigo.com On 29/10/12 15:59, Danny Blazejczak via RT wrote: Show quoted text
> Queue: File-Tail-Dir > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80457 > > > Hi Jon, > > Thanks for the quick response. > > Got the 2nd issue to work with following changes: > Line 470 : $SIG{USR1} = sub { > Change to : $SIG{INT} = sub { > Line 500 : kill SIGUSR1, $pid; > Change to : kill SIGINT, $pid; > So this solves when the option (autostate_delay => 1) is set. The state is correctly updated in this case with the previous code changes. > > I also found that I could get around the 2nd issue by setting (autostate_delay => 0). Here again, the state is correctly updated. > > So, the workarounds by first creating the temp dir, and setting autostate_delay => 0 , would work with the current version. Here is my script, it may help someone in the mean time: > > #!/usr/bin/perl > use strict; > use warnings; > use diagnostics; > > use File::Tail::Dir; > use File::Basename; > use Sys::Hostname; > use POSIX qw/strftime/; > use Cwd; > > # Workaround 1 : pre-create temp file. > my $cwd = getcwd; > my $tmpdir = $cwd . "/tmp/"; > mkdir $tmpdir; > open(FH,'>tmp/.filetaildirwatchdog') or die "Can't create file: $!"; > close(FH); > > my $host = hostname; > my @_DIRECTORIES = ['C:/projects/1/','C:/projects/2/']; > my $tailer = File::Tail::Dir->new( > directories => @_DIRECTORIES, > filter => qr/.*log$/, > private_dir => $tmpdir, > autostate => 1, > # 0 - 0=update for every change. (value in sec) > # 1 - error ".filetaildirwatchdog: No such file or directory" > autostate_delay => 0, > ); > #$tailer->save_state(); > $tailer->watch_files(); > > > Regards, > Danny > > > > From: jon.schutz@youramigo.com via RT [mailto:bug-File-Tail-Dir@rt.cpan.org] > Sent: Monday, 29 October 2012 12:06 PM > To: Danny Blazejczak (AU) > Subject: Re: [rt.cpan.org #80457] Error with .filetaildirwatchdog on windows > > > > <URL: https://rt.cpan.org/Ticket/Display.html?id=80457 > > > Hi Danny, > > I don't have a test environment set up on Windows so I'll need your > assistance to fix... > > Re the second issue, if you change SIGUSR1 to another signal (sounds > like SIGINT might be the best choice for windows), does that solve the > problem? If so I can allow the signal to be user-specified. > > Re the first issue, I will look into it properly when I have a moment. > > Regards, > > -- > Jon Schutz > CTO, YourAmigo Ltd > 53 Gilbert St > Adelaide SA 5000 > Ph: +61 8 82119211 > Fax: +61 8 8211 6356 > http://www.youramigo.com > > > > On 29/10/12 10:52, Danny Blazejczak via RT wrote:
>> Sun Oct 28 20:22:13 2012: Request 80457 was acted upon. >> Transaction: Ticket created by danny.blazejczak@dimensiondata.com<mailto:danny.blazejczak@dimensiondata.com> >> Queue: File-Tail-Dir >> Subject: Error with .filetaildirwatchdog on windows >> Broken in: (no value) >> Severity: (no value) >> Owner: Nobody >> Requestors: danny.blazejczak@dimensiondata.com<mailto:danny.blazejczak@dimensiondata.com> >> Status: new >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80457 > >> >> >> Hi Jon, >> >> Thanks as well for this File::Tail::Dir module. It seems to do exactly what I need. >> >> I am testing this module at the moment on Windows 7 - SP1. The '_start_watchdog' is causing problems on this OS though, when saving state. Maybe this functionality is not intended to work on Windows? >> Perl version = v5.16.1 built for MSWin32-x86-multi-thread >> Module version = File-Tail-Dir-0.12 >> >> When saving state I have this error: >> >> Uncaught exception from user code: >> C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirwatchdog: No such file or directory at C:/perl/perl/site/lib/File/Tail/Dir.pm line 454. >> >> Cwd::_croak('C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirw...') called at C:/perl/perl/lib/Cwd.pm line 630 >> Cwd::fast_abs_path('C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirw...') called at C:/perl/perl/site/lib/File/Tail/Dir.pm line 454 >> File::Tail::Dir::_start_watchdog('File::Tail::Dir=HASH(0x2cf561c)') called at C:/perl/perl/site/lib/File/Tail/Dir.pm line 411 >> File::Tail::Dir::watch_files('File::Tail::Dir=HASH(0x2cf561c)') called at multitail.pl line 45 >> >> When looking at the code, in File::Tail::Dir.pm , line 454: >> my $filename = abs_path(File::Spec->catfile($self->private_dir, $_dotfile)); >> the abs_path function checks if the file exists (Cwd:: fast_abs_path - line 630). The file (.filetaildirw ) does not exist yet at this point, and hence the failure. >> >> As a workaround, I created this file at the start of my script. In this scenario the script goes a bit further, but fails at '$SIG{USR1}', which is a Unix signal, not recognized on Windows: >> No such signal: SIGUSR1 at C:/perl/perl/site/lib/File/Tail/Dir.pm line 472, >> <__ANONIO__> line 12 (#1) >> (W signal) You specified a signal name as a subscript to %SIG that was >> not recognized. Say kill -l in your shell to see the valid signal >> names on your system. >> >> I think I use the module correctly, as follows: >> my @_DIRECTORIES = ['C:/projects/1/','C:/projects/2/']; >> my $tailer = File::Tail::Dir->new( >> directories => @_DIRECTORIES, >> filter => qr/.*log$/, >> autostate => 1, >> # 0 - 0=update for every change. (value in sec) >> # does not seem to work (no .filetaildirstate) - but no error >> # 1 - error ".filetaildirwatchdog: No such file or directory" >> autostate_delay => 1, >> ); >> $tailer->watch_files(); >> >> When I set the 'autostate_delay => 0', I do not get the error, but also the state file is not saved. >> >> Maybe there is something else I am missing? >> >> Thanks for any help with this, >> Danny >>
> > itevomcid
Subject: RE: [rt.cpan.org #80457] Error with .filetaildirwatchdog on windows
Date: Tue, 6 Nov 2012 09:31:36 +1100
To: "bug-File-Tail-Dir [...] rt.cpan.org" <bug-File-Tail-Dir [...] rt.cpan.org>
From: "Danny Blazejczak (AU)" <danny.blazejczak [...] dimensiondata.com>
Thanks Jon. Tested this without the workarounds and works fine now on windows. Regards, Danny From: jon.schutz@youramigo.com via RT [mailto:bug-File-Tail-Dir@rt.cpan.org] Sent: Friday, 2 November 2012 11:00 PM To: Danny Blazejczak (AU) Subject: Re: [rt.cpan.org #80457] Error with .filetaildirwatchdog on windows <URL: https://rt.cpan.org/Ticket/Display.html?id=80457 > Hi Danny, I have put in some fixes for Windows. SIGINT will be automatically selected if on Windows, or you can specify the signal to use using watchdog_signal_name. Only signals available on the current OS are allowed. The watchdog file is created before calling abs_path. Regards, -- Jon Schutz CTO, YourAmigo Ltd 53 Gilbert St Adelaide SA 5000 Ph: +61 8 82119211 Fax: +61 8 8211 6356 http://www.youramigo.com On 29/10/12 15:59, Danny Blazejczak via RT wrote: Show quoted text
> Queue: File-Tail-Dir > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80457 > > > Hi Jon, > > Thanks for the quick response. > > Got the 2nd issue to work with following changes: > Line 470 : $SIG{USR1} = sub { > Change to : $SIG{INT} = sub { > Line 500 : kill SIGUSR1, $pid; > Change to : kill SIGINT, $pid; > So this solves when the option (autostate_delay => 1) is set. The state is correctly updated in this case with the previous code changes. > > I also found that I could get around the 2nd issue by setting (autostate_delay => 0). Here again, the state is correctly updated. > > So, the workarounds by first creating the temp dir, and setting autostate_delay => 0 , would work with the current version. Here is my script, it may help someone in the mean time: > > #!/usr/bin/perl > use strict; > use warnings; > use diagnostics; > > use File::Tail::Dir; > use File::Basename; > use Sys::Hostname; > use POSIX qw/strftime/; > use Cwd; > > # Workaround 1 : pre-create temp file. > my $cwd = getcwd; > my $tmpdir = $cwd . "/tmp/"; > mkdir $tmpdir; > open(FH,'>tmp/.filetaildirwatchdog') or die "Can't create file: $!"; > close(FH); > > my $host = hostname; > my @_DIRECTORIES = ['C:/projects/1/','C:/projects/2/']; > my $tailer = File::Tail::Dir->new( > directories => @_DIRECTORIES, > filter => qr/.*log$/, > private_dir => $tmpdir, > autostate => 1, > # 0 - 0=update for every change. (value in sec) > # 1 - error ".filetaildirwatchdog: No such file or directory" > autostate_delay => 0, > ); > #$tailer->save_state(); > $tailer->watch_files(); > > > Regards, > Danny > > > > From: jon.schutz@youramigo.com<mailto:jon.schutz@youramigo.com> via RT [mailto:bug-File-Tail-Dir@rt.cpan.org] > Sent: Monday, 29 October 2012 12:06 PM > To: Danny Blazejczak (AU) > Subject: Re: [rt.cpan.org #80457] Error with .filetaildirwatchdog on windows > > > > <URL: https://rt.cpan.org/Ticket/Display.html?id=80457 > > > Hi Danny, > > I don't have a test environment set up on Windows so I'll need your > assistance to fix... > > Re the second issue, if you change SIGUSR1 to another signal (sounds > like SIGINT might be the best choice for windows), does that solve the > problem? If so I can allow the signal to be user-specified. > > Re the first issue, I will look into it properly when I have a moment. > > Regards, > > -- > Jon Schutz > CTO, YourAmigo Ltd > 53 Gilbert St > Adelaide SA 5000 > Ph: +61 8 82119211 > Fax: +61 8 8211 6356 > http://www.youramigo.com > > > > On 29/10/12 10:52, Danny Blazejczak via RT wrote:
>> Sun Oct 28 20:22:13 2012: Request 80457 was acted upon. >> Transaction: Ticket created by danny.blazejczak@dimensiondata.com<mailto:danny.blazejczak@dimensiondata.com> >> Queue: File-Tail-Dir >> Subject: Error with .filetaildirwatchdog on windows >> Broken in: (no value) >> Severity: (no value) >> Owner: Nobody >> Requestors: danny.blazejczak@dimensiondata.com<mailto:danny.blazejczak@dimensiondata.com> >> Status: new >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=80457 > >> >> >> Hi Jon, >> >> Thanks as well for this File::Tail::Dir module. It seems to do exactly what I need. >> >> I am testing this module at the moment on Windows 7 - SP1. The '_start_watchdog' is causing problems on this OS though, when saving state. Maybe this functionality is not intended to work on Windows? >> Perl version = v5.16.1 built for MSWin32-x86-multi-thread >> Module version = File-Tail-Dir-0.12 >> >> When saving state I have this error: >> >> Uncaught exception from user code: >> C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirwatchdog: No such file or directory at C:/perl/perl/site/lib/File/Tail/Dir.pm line 454. >> >> Cwd::_croak('C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirw...') called at C:/perl/perl/lib/Cwd.pm line 630 >> Cwd::fast_abs_path('C:\Users\dblazejc\AppData\Local\Temp\rgGwJbGvkJ\.filetaildirw...') called at C:/perl/perl/site/lib/File/Tail/Dir.pm line 454 >> File::Tail::Dir::_start_watchdog('File::Tail::Dir=HASH(0x2cf561c)') called at C:/perl/perl/site/lib/File/Tail/Dir.pm line 411 >> File::Tail::Dir::watch_files('File::Tail::Dir=HASH(0x2cf561c)') called at multitail.pl line 45 >> >> When looking at the code, in File::Tail::Dir.pm , line 454: >> my $filename = abs_path(File::Spec->catfile($self->private_dir, $_dotfile)); >> the abs_path function checks if the file exists (Cwd:: fast_abs_path - line 630). The file (.filetaildirw ) does not exist yet at this point, and hence the failure. >> >> As a workaround, I created this file at the start of my script. In this scenario the script goes a bit further, but fails at '$SIG{USR1}', which is a Unix signal, not recognized on Windows: >> No such signal: SIGUSR1 at C:/perl/perl/site/lib/File/Tail/Dir.pm line 472, >> <__ANONIO__> line 12 (#1) >> (W signal) You specified a signal name as a subscript to %SIG that was >> not recognized. Say kill -l in your shell to see the valid signal >> names on your system. >> >> I think I use the module correctly, as follows: >> my @_DIRECTORIES = ['C:/projects/1/','C:/projects/2/']; >> my $tailer = File::Tail::Dir->new( >> directories => @_DIRECTORIES, >> filter => qr/.*log$/, >> autostate => 1, >> # 0 - 0=update for every change. (value in sec) >> # does not seem to work (no .filetaildirstate) - but no error >> # 1 - error ".filetaildirwatchdog: No such file or directory" >> autostate_delay => 1, >> ); >> $tailer->watch_files(); >> >> When I set the 'autostate_delay => 0', I do not get the error, but also the state file is not saved. >> >> Maybe there is something else I am missing? >> >> Thanks for any help with this, >> Danny >>
> > itevomcid
Marking resolved.