Re: LWPng patch to fix binmode problems on Windows NT
Ed (ed@chronos.net)
Wed, 14 Apr 1999 23:15:54 +0100 (WEST)
On Wed, 14 Apr 1999, Blair Zajac wrote:
> I'm including a patch below for LWP::Conn::FILE that fixes a problem
> when LWPng is used on Windows systems and either binary or text files
> are being read from local disk. The current code would never read
> the file in binary mode and hence could not read binary data containing
> control-Z's. The patch below uses the guess_media_type subroutine
> to switch the reading of the file into binary using binmode unless
> the file is of a type text. The code may need to be adopted more
> as other
I do not think this is the right approach. Much better would be to
binmode always, and let any code that wants to turn DOS text into
Unix text can do so with an s///.
--
Ed | | mailto:ed@chronos.net
Chronos.Net | http://www.chronos.net/ | mailto:info@chronos.net