What's the Lua to get the current working directory on Windows XP SP3 (or to get the directory of the currently-running Lua file)? I prefer not to use LuaFileSystem.
I can't use os.execute("cd")
because os.execute
always starts from my home directory (and thus always yields C:\Documents and Settings\username
).
maybe some ugly hack like
current_dir=io.popen"cd":read'*l'