gpt4 book ai didi

module - 在 Windows 7 上找不到 File::Find Raku

转载 作者:行者123 更新时间:2023-12-03 16:16:21 25 4
gpt4 key购买 nike

我有一个非常简单的程序,它列出了所有 .txt给定目录中的文件。这个程序在我的 Rakudo Star 版本 2019.03.1 的 Mac 上完美运行

use File::Find;

my $folder="../Documents";

.say for find dir => $folder, name => /'.txt' $/;
当我尝试在具有 Raku 2020.12.1 的 Windows 7 上运行相同的程序时,它给出了以下信息:
$ raku html-adder.rk

===SORRY!=== Error while compiling C:\Users\lars\raku/html-adder.rk

Could not find File::Find in:
inst#C:\Users\lars\.raku
inst#C:\Programs\rakudo-moar-2021.02.1\share\perl6\site
inst#C:\Programs\rakudo-moar-2021.02.1\share\perl6\vendor
inst#C:\Programs\rakudo-moar-2021.02.1\share\perl6\core
ap#
nqp#
perl5#
at C:\Users\lars\raku/html-adder.rk:12
我已将 Raku 更新到版本 Raku 2021.02.1 并再次出现相同的错误。我已经通过解压 rakudo-moar-2021.02.1-01-win-x86_64-msvc.zip 来安装它即不使用任何安装程序。至于 Mac 上的 Raku,我不记得安装了 File::Find模块,我也不知道如何列出已安装的模块,即我没有检查 File::Find安装在 Mac 或 Windows 7 上。
如何让这个程序在 Windows 7 上运行?

最佳答案

File::Find未内置于 Raku 或与 Rakudo Star 一起分发;据我所知,从来没有。
这是一个 module in the ecosystem您可以使用 Zef 安装(使用命令 zef install File::Find )。
它也是一个很短的图书馆。如果您有兴趣在不添加依赖项的情况下修复脚本,您可能需要查看 the source code对于文件::查找;它足够短,您可以轻松地自己实现相同的功能。

关于module - 在 Windows 7 上找不到 File::Find Raku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66627650/

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