Folder.home.subfolders.recursive.forEach { folder in print("Name : \(folder.name), parent: \(folder.parent)") } If there are too many files in the folder, it will crash during the recursive process