Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find File::Find Raku on Windows 7

I've got a very simple program which lists all .txt files in a given directory. This program has run perfectly on my Mac which has the Rakudo Star version 2019.03.1

use File::Find;

my $folder="../Documents";

.say for find dir => $folder, name => /'.txt' $/;

When I've tried to run the same program on Windows 7 which had Raku 2020.12.1 it gave this:

$ 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

I've updated the Raku to version Raku 2021.02.1 and the same error again. I've installed it by unzipping the rakudo-moar-2021.02.1-01-win-x86_64-msvc.zip i.e. without using any installer. And as regards to the Raku on Mac, I don't remember installing the File::Find module, nor do I know how to list the installed modules, i.e. I haven't checked if File::Find was installed on Mac or Windows 7.

How to make this program work on Windows 7?

like image 449
Lars Malmsteen Avatar asked Mar 14 '21 17:03

Lars Malmsteen


1 Answers

File::Find is not built into Raku or distributed with Rakudo Star; to my knowledge, it never has been.

It is a module in the ecosystem that you can install with Zef (use the command zef install File::Find).

It is also a very short library. If you are interested in fixing your script without adding a dependency, you may want to check out the source code for File::Find; it is short enough that you could easily implement the same functionality yourself.

like image 153
codesections Avatar answered Nov 08 '22 16:11

codesections