lua-users home
lua-l archive

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


Hello,

What would be a reasonable way to guess the directory separator (e.g. / or \) from a Lua script?

Presently, I'm parsing the package.path, but perhaps there is a more reliable way to achieve this?

print( package.path:match( "(%p)%?%." ) )

> /

I noticed a LUA_DIRSEP in luaconf.h. Is that accessible from a Lua script? Some of this information seems to be pushed into package.config by loadlib.c:

config  /
;
?
!
-

Would it be reckless to rely on this undocumented (?) package.config string?

Thanks.

PA.