Skip to content

Instantly share code, notes, and snippets.

@singularitti
Created January 19, 2026 03:46
Show Gist options
  • Select an option

  • Save singularitti/16857639470948d185d9b3ba4a703314 to your computer and use it in GitHub Desktop.

Select an option

Save singularitti/16857639470948d185d9b3ba4a703314 to your computer and use it in GitHub Desktop.
List strings to those that exist as valid filesystem paths #Julia #file-system
function list_valid_paths(paths)
valid = []
for p in paths
try
expanded = expanduser(p)
if ispath(expanded)
push!(valid, expanded)
end
catch
# Ignore malformed paths or permission issues
end
end
return valid
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment