本文介绍了确定Lua编译器运行32位还是64位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前在默认开发系统上使用Windows,在部署Lua脚本的服务器上使用Linux.对于Windows,只有几个32位解释器,例如适用于Windows的Lua 我目前使用的(至少据我所知).在服务器上,解释器以64位运行脚本.

I am currently using Windows on my default development system and Linux on my server where I deploy my Lua scripts. For Windows there are only several 32 bit interpreters like Lua for Windows one I currently use (at least as far as i know). On the server the interpreter is running the scripts on 64 bits.

现在我的问题是:是否可以检查脚本在哪种体系结构上运行(可能类似于该版本的_ENV变量)?

Now my question is: Is it possible to check on which architecture the script is running (probably similar to the _ENV variable for the version)?

推荐答案

如果可以获取.

我也对通过Lua脚本(以及与Lua和LuaJIT解释器一起使用的脚本)执行此操作的更简单方法感兴趣,因为我遇到了一种情况,我想根据32bit是否引用不同的路径或64位库需要加载而无需用户指定这些路径.

I'm also interested in simpler ways to do it from a Lua script (and the one that works with Lua and LuaJIT interpreters), as I ran into a case when I'd like to reference different paths depending on whether 32bit or 64bit library needs to be loaded without the user having to specify those paths.

这篇关于确定Lua编译器运行32位还是64位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 09:03