3 ms·
Why bother with invoking shell programs instead of using built-in ways of the language to do the same task? let result = try! FileManager.default.contentsOfD
by fainpul 1y ago
Why bother with invoking shell programs instead of using built-in ways of the language to do the same task?
let result = try! FileManager.default.contentsOfDirectory(atPath: "/etc")
print(result)
Various other FileManager methods are available:
https://developer.apple.com/documentation/foundation/filemanager#Discovering-directory-contents https://developer.apple.com/documentation/foundation/fileman...