Subject: | File::Logreader on Windows... |
Date: | Tue, 18 May 2010 12:23:36 -0400 |
To: | bug-File-LogReader [...] rt.cpan.org |
From: | "Prehn, Eric" <EPREHN [...] hcr-manorcare.com> |
To whom it may concern:
I needed to make some modifications to the module in order for it to
work with Windows. I'm using version 0.4 of the File::logreader module
on Windows 2003 on perl v5.6.1 build 638. I'd imagine these changes
would apply across perl platforms though.
First, in order to make it work on windows reading a log file from a UNC
path, I needed to change the backslash used in the substitution where it
defines the state file name. In order to make it work for both unix and
windows, it probably needs to determine which slashes are present and
base the substitution used on that. (Line 71?)
Secondly, Windows allows you to seek to a position past the end of the
file (apparently), so I changed the section that tests if the file is
smaller to define the $pos variable by seeking to the end of the file
instead. Then the comparison between the state file position and the
end of the file is accurate to see if the file size has gotten smaller.
(Line 122?)
And finally, in order to have the hash work correctly, I need to set $fh
to binmode right before it reads in for creating the hash. (Line 154?)
Eric Prehn
------------------------------------------------------------------------------
The information contained in this transmission is intended
only for the person or entity to which it is addressed
and may contain confidential and/or privileged material.
If you are not the intended recipient of this information,
do not review, retransmit, disclose, disseminate, use, or
take any action in reliance upon, this information. If you
received this transmission in error, please contact the
sender, destroy all printed copies, and delete the
material from all computers.
==============================================================================