lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Thu, 21 Aug 2008 18:27:57 -0300
"Hugo Schmitt" <> top-posted:

> Or for that specific case
> return os.getenv("PWD")

Which won't work if the process's working directory has chanced since

> require "posix"
> posix.chdir "Desktop"
> = os.getenv "PWD"
> = io.popen("pwd", "r"):read "*a"

Of course, if you're using lposix, you'd just do this:

> = posix.getcwd()

But the current working directory could have been changed in any number
of ways.