使用 scons 创建空目录

问题描述

我正在尝试将新的空文件添加到现有项目中。在 sconscript.3dn 文件中我使用:

Import('env_rcp')
e = env_rcp.Clone()
# another code ...
e.Execute(e.Mkdir('$RUNTIMEDIR/resources'))

在本地构建时,我得到 AttributeError: 'SConsEnvironment' object has no attribute 'Mkdir'

我也试过 os.Mkdir('$RUNTIMEDIR/resources'),然后我得到 AttributeError: 'module' object has no attribute 'Mkdir'

缺少某些导入,或者我应该以某种方式定义 Mkdir 吗?在 Scons manual 我没有找到太多帮助

解决方法

解决方案是:e.Execute(Mkdir('$RUNTIMEDIR/resources'))