- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
各位
当我将我的包部署到 linux 环境时,我遇到了这个错误:
.../Linux-2.6c2.5-i686/Ncurses/Ncurses-15766.0-0/lib/libncurses.so.5 is encountered a second time at /apollo/_env/FBAMerchantAutoRemovalDaemon-swit1na.1755067.237551097.1107633519/perl/lib/perl5.8-dist/File/Find.pm line 542.
尽管我阅读了 perl
脚本,但我不知道哪里出了问题。我怀疑我的环境被污染了。有谁知道出了什么问题,我该如何调试这个问题?非常感谢!
哲
最佳答案
follow
Causes symbolic links to be followed. Since directory trees with symbolic links (followed) may contain files more than once and may even have cycles, a hash has to be built up with an entry for each file. This might be expensive both in space and time for a large directory tree. See "
follow_fast
" and "follow_skip
" below. If eitherfollow
orfollow_fast
is in effect:It is guaranteed that an
lstat
has been called before the user'swanted()
function is called. This enables fast file checks involving_
. Note that this guarantee no longer holds iffollow
orfollow_fast
are not set.There is a variable
$File::Find::fullname
which holds the absolute pathname of the file with all symbolic links resolved. If the link is a dangling symbolic link, then fullname will be set toundef
.
因此,如果出于您的应用程序的目的,如果可以跟随符号链接(symbolic link),请使用 follow
选项集调用 find
:
find({ wanted => \&process, follow => 1 }, $dir);
或者,考虑其他 follow_skip
行为是否更适合您的应用程序:
follow_skip
follow_skip==1
, which is the default, causes all files which are neither directories nor symbolic links to be ignored if they are about to be processed a second time. If a directory or a symbolic link are about to be processed a second time,File::Find
dies.
follow_skip==0
causesFile::Find
to die if any file is about to be processed a second time.
follow_skip==2
causesFile::Find
to ignore any duplicate files and directories but to proceed normally otherwise.
follow_skip => 2
可能更适合您的应用程序。只有您可以做出决定。
关于linux - find.pm 错误 "encountered a second time",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40733181/
我是一名优秀的程序员,十分优秀!