940329 - -f在具有unicode名称的文件上无法正常工作 [英] 940329 - -f doesn't work correctly on files with unicode names
本文介绍了940329 - -f在具有unicode名称的文件上无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在windows下的perl(activeperl)当我想检查路径是文件还是目录而路径是否包含非西方字符时,-f和-d都不会在真正存在的文件上返回true。
我该怎么办?
解决方案
使用 testL 函数http://search.cpan.org/~rboisvert/Win32-LongPath-1.03/lib/Win32/LongPath.pm\">Win32::LongPath [ ^ ]我在回答你上一个问题时建议的CPAN模块:
die
文件不是常规文件 如果 testL(' f',
file < /跨度>);
in perl under windows (activeperl) when i want to check whether a path is a file or directory and the path includes non-western characters, neither -f nor -d return true on a file which really exists.
what can i do?
解决方案
Use thetestL
function from the Win32::LongPath[^] CPAN module I suggested in my answer to your last question:
die "
file is not a regular file" if testL ('f',
file);
这篇关于940329 - -f在具有unicode名称的文件上无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文