现在的问题不是说不能计算md5,两种模式都可以计算,我想确认一下两种模式的区别,还有对硬盘IO的读取和写入利用的频繁程度,我在确认问题出现的地方,如果确实是
IO::File 对硬盘造成大量的读写导致的 read-only system 错误,我就要换个方式来处理这个问题了,比如用第一种方法或者其他方式

我现在不能确定换了第一种方法是否可以减少对文件系统的 IO 使用

2009/12/21 Qiang (James) <[email protected]>

> 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 讨论组”论坛。
> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。
> 要取消订阅此网上论坛,请发送电子邮件至 
> [email protected]<perlchina%[email protected]>
> 。
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>
>
>

--

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


回复