Lua在macOS主目录中为何不能用io.open进行文件操作?

2026-04-01 19:330阅读0评论SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计412个文字,预计阅读时间需要2分钟。

Lua在macOS主目录中为何不能用io.open进行文件操作?

我正在编写一个Mac OS程序,以下是几行代码:

pythonos.execute(cd ~>/testdir)configfile=io.open(configfile.cfg, w)configfile.write(hello)configfile.close()

问题是,它只在我的脚本当前目录中创建配置文件,而不是我想要的。

阅读全文

本文共计412个文字,预计阅读时间需要2分钟。

Lua在macOS主目录中为何不能用io.open进行文件操作?

我正在编写一个Mac OS程序,以下是几行代码:

pythonos.execute(cd ~>/testdir)configfile=io.open(configfile.cfg, w)configfile.write(hello)configfile.close()

问题是,它只在我的脚本当前目录中创建配置文件,而不是我想要的。

阅读全文