首页 > 解决方案 > 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?

标签: swiftlinuxmacos

解决方案


推荐阅读