setenv invalid description
For setenv you write that this function set variable only to childe process. This is not true. To test
local winapi = require"winapi"
os.execute("git help") -- this call fail
local path = os.getenv("PATH") .. ';c:\\git\\bin'
winapi.setenv("path", path)
os.execute("git help") -- but this pass
getenv create snpshot Environments while load dll and then return same variable. In my env library i write tests to check all possible variants and os.getenv never get new value, but GetEnvironmentVariable/getnev(from my dll)/getenv_s/environ return new value. May be on *nix this is not true.
OK, that makes sense - os.getenv() is a portable version, but does not fully behave as it should (not an uncommon problem with Windows). So maybe winapi.getenv? Does this matter enough? I agree that the description should be updated.
I implement 5 functions for env get/set/expand/environ/update. Update broadcast WM_SETTINGCHANGE like MSDN says, but i can not understand how it work. You can use my implementation of env functions.
So maybe winapi.getenv? Does this matter enough?
I use my lib loader that automatically append ENV.PATH before load cmodule to find depedency .dll
local path = path_jopin(LIB_ROOT, 'path')
if dir_exists(path) then
ENV.PATH = path .. ';' .. ENV.PATH
end