Remove Sub-Folders from the Filesystem
Sort the folder paths so every parent comes before its sub-folders, then keep a path only when it is not under the last kept folder.
Sort the folder paths so every parent comes before its sub-folders, then keep a path only when it is not under the last kept folder.