2009年12月20日星期日

Re: [PerlChina] 文件 md5 两种算法,区别在哪里

Hong Mayi wrote:
> Dear all
> Digest::MD5->new->addfile(*FILE)
>
> 和
>
> Digest::MD5->new->addfile(IO::File->new($file))
>
> 有什么区别?
>
> 我用第二种算法,linux 机器经常出现 read only system 的错误,不知道是不是
> 因为 IO::File 的问题

Digest::MD5 文档里提到

$md5->addfile($io_handle)
In most cases you want to make sure that the $io_handle is in binmode
before you pass it as argument to the addfile() method.

binmode 试试。

Qiang

--

您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

没有评论: