Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
File::Map有没有办法使用该模块进行某种部分文件映射?
File::Map
如果我写
map_file($map, $filename);
它告诉我这个操作没有足够的内存。
看来我的文件太大了,无法将它们完全映射到内存中。我可以逐块映射它们吗?
根据文档,是的:map_file 可以采用两个可选参数$offset和$length
$offset
$length
如果您正在映射文本文件,那么您应该使用Tie::File。它将根据需要将文件的必要部分分页进出内存,并且您永远不会达到限制。
Tie::File