官网 http://www.chilkatsoft.com/
Chilkat 是一个跨平台的 API 接口,支持多种语言,提供网络、文本、文件系统、算法库。
其中大部分功能可免费使用(部分功能需要获得许可)
文档
示例
[Perl]Chilkat模块
- paktc
- 出类拔萃
- 帖子: 65
- 注册时间: 2016年07月21日 20:34
- 联系:
目录树遍历,以及Unicode路径名称的支持 Re: [Perl]Chilkat模块
CkDirTree参考文档
dirTree_iterate示例
该模块支持Unicode路径名称,通过 put_Utf8 打开编码开关,将上面代码稍作修改:
dirTree_iterate示例
Code: [show] | [select all]
use chilkat(); use File::Slurp; $dirTree = chilkat::CkDirTree->new(); $dirTree->put_BaseDir("F:/temp/UPathTest"); $dirTree->put_Recurse(1); $dirTree->put_Utf8(1); $success = $dirTree->BeginIterate(); if ($success != 1) { print $dirTree->lastErrorText() . "\r\n"; exit; } my $buff = ""; while ($dirTree->get_DoneIterating() != 1) { $buff .= $dirTree->fullPath() . "\r\n"; # Advance to the next file or sub-directory in the tree traversal. $success = $dirTree->AdvancePosition(); if ($success != 1) { if ($dirTree->get_DoneIterating() != 1) { print $dirTree->lastErrorText() . "\r\n"; exit; } } } write_file("Files.txt", {"binmode"=>":raw"}, $buff );
在线用户
正浏览此版面之用户: 没有注册用户 和 1 访客