我正在努力通过将显示逻辑重构为lua函数来简化我的conky,但我找不到任何如何传递文件路径的示例,并且我的猜测尝试会产生脚本错误。conky_display_fs("Home", execution failed: attempt to call a nil value 所以,我猜问题出在我传递路径字符串的方式上,因为它只显示错误中的第一个值我想到了字符串转义等,但conky配置的其他部分中使用
有没有一种方法可以将堆上分配的对象返回给lua,而不对它们进行“缓存”引用?How to transfer the ownership of 's' to lua?};
如果将字符串返回给已分配的内存,则必须将其删除。有没有办法把所有权转让给lua?或者是否可以让lua_state*实现使用lua_pushstring(...)返回的字符串?
在lua中,我正在阅读一个文本文件,其中的几行可能包含单引号或双引号,例如:“L‘’habitude comme un file de soie et devient vite un cble d‘’acier”- Proverbe espagnollocal cmd = 'zenity --question --no-wrap --title "pause" --text' .. string.format("%q", quote)
p