edubart / nelua-lang

Minimal, efficient, statically-typed and meta-programmable systems programming language heavily inspired by Lua, which compiles to C and native code.
https://nelua.io
MIT License
1.99k stars 64 forks source link

LFS: can't change directory with `lfs.chdir` #257

Closed cattokomo closed 4 months ago

cattokomo commented 4 months ago

I've encountered that lfs.chdir doesn't change the CWD of the process, and it doesn't throw any error.

local lfs = require("lfs")
local fs = require("nelua.utils.fs")

print(fs.curdir()) --> /path/to
print(lfs.chdir("/path/to/something")) --> true    /path/to/something
print(fs.curdir()) --> /path/to

Environment

Provide relevant information about your environment:

cattokomo commented 4 months ago

Seems like it fixed on it's own.