It is necessary to learn tech. OS (to set the work path). How to do it?

  • one
    use os.capture 'uname' for linux / mac: if an error, then windows. On SO there are some tips - approximatenumber
  • @approximatenumber, os.capture needs to be defined (on SO is like) - val

1 answer 1

methods for determining the platform are set forth, for example, in the documentation .

an example using the apr library, in particular, the apr.platform_get () function, which can return one of the strings — UNIX , WIN32 , OS2 , or OS2 :

 apr = require ("apr") print (apr.platform_get())