David Haley said:
If you only ever use the file scanner in conjunction with dofile, why not use require?
Because the file might not be in the lua search path. I want to be able to keep all my plugins in one directory and find files in other places if I want to use them. Such as telnet_options.lua in the new aardwolf client, which is not on the lua path.
Nick Gammon said:
In the file commas.lua which is currently in the distribution, you have a generic directory scanner.
Whilst that doesn't look for a particular file, you could add in a function that checks the trailing part of the file name (after the final slash) to see if it is the required file or not. If so, then do a "dofile" on the full path.
I did not know to look in commas.lua, but that seems a little complicated for just searching for a file in a directory tree.
Bast |