Can I configure NSH (or the fs driver) to ignore preceding "./“ (dot
slash) characters when reading directories or opening files?

For example, the following does not work in NSH:

```
nsh> echo "hello" > hello.txt
nsh> ls .
/sd:
 hello.txt
nsh> ls ./
nsh: ls: stat failed: 2
nsh> cat hello.txt
hello
nsh> cat ./hello.txt
nsh: cat: open failed: 20
```

I believe POSIX compatible shells in Unix allow this.

The reason I ask is because part of the default module search path in
the Lua interpreter is "./?lua" and "./?/init.lua”.  This will try to
open a “./foo.lua” or “./foo/init.lua” file for a “foo =
require(‘foo’)” statement. This currently fails because of the
preceding dot slash. I can patch the default module search path when
building Lua for NuttX. But I prefer to keep the behavior of the Lua
interpreter consistent across desktop and NuttX.

Reply via email to