swift - Swift: Is there an OS agnostic way to get the home directory?
问题描述
See title. I want to create the data files for my CLI application preferably in ~/
or ~/config
, but predefined Swift FileManager.default.url()
doesn't seem to have it.
.homeDirectoryForCurrentUser
seems to be available only for macOS Sierra and later.
Any ideas?
解决方案
推荐阅读
- c++ - 函数重新分配c字符串后delete []时出现无效指针错误
- java - 在 Intellij IDEA 中用 build.gradle 替换 Build Artifact
- angular - Angular 中的条件布局,带有两个导航栏
- excel - Excel公式用逗号从单元格中分隔数字
- python - 如何使用注意力机制对 RNN 建模以进行非文本分类?
- python - sqlalchemy-sqlite 数据库当前(01/2018)是否与 JSON 对象直接兼容?
- jquery - 如何在 JQUERY 中选择具有特定属性的 div 内的元素?
- javascript - 如何获取函数中父标签的属性值?
- mysql - MYSQL中带参数的存储过程
- html - 将材质 ui 表包裹在 div 内