gpt4 book ai didi

linux - find.pm 错误 "encountered a second time"

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:42:55 24 4
gpt4 key购买 nike

各位

当我将我的包部署到 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 脚本,但我不知道哪里出了问题。我怀疑我的环境被污染了。有谁知道出了什么问题,我该如何调试这个问题?非常感谢!

最佳答案

来自 perldoc File::Find

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 either follow or follow_fast is in effect:

It is guaranteed that an lstat has been called before the user's wanted() function is called. This enables fast file checks involving _. Note that this guarantee no longer holds if follow or follow_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 to undef.

因此,如果出于您的应用程序的目的,如果可以跟随符号链接(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 causes File::Find to die if any file is about to be processed a second time.

follow_skip==2 causes File::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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com