Skip to content

Instantly share code, notes, and snippets.

@andrewwoz
Last active October 15, 2019 06:05
Show Gist options
  • Select an option

  • Save andrewwoz/48411559334b46895f2e493da9125440 to your computer and use it in GitHub Desktop.

Select an option

Save andrewwoz/48411559334b46895f2e493da9125440 to your computer and use it in GitHub Desktop.

Revisions

  1. andrewwoz revised this gist Oct 15, 2019. No changes.
  2. andrewwoz revised this gist Oct 14, 2019. No changes.
  3. andrewwoz created this gist Oct 14, 2019.
    7 changes: 7 additions & 0 deletions deep_enum_directory.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    // Performs a deep enumeration of the specified directory and returns the paths of all of the contained subdirectories.
    guard let documents = try? fs.url(for: .documentDirectory,
    in: .userDomainMask,
    appropriateFor: nil,
    create: false) else { return }

    let subpaths = try! fs.subpathsOfDirectory(atPath: documents.path)