gpt4 book ai didi

ironruby - 如何获取 IronRuby 中的当前工作目录?

转载 作者:行者123 更新时间:2023-12-01 22:32:02 26 4
gpt4 key购买 nike

我想知道如何读取由 IronRuby“解析”的文件的当前工作目录。看起来“执行目录”与ir.exe文件相同。

我需要它来创建 XNA 解决方案中内容的相对路径,而不需要对路径进行硬编码。

最佳答案

来自Class:Dir :

Dir.getwd => string
Dir.pwd => string

Returns the path to the current working directory of this process as a string.

Dir.chdir("/tmp") #=> 0
Dir.getwd #=> "/tmp"

关于ironruby - 如何获取 IronRuby 中的当前工作目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1248558/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com