Println(joinpath(root, dir)) # path to directories
onerror is called with a IOError as argument.Įxamples for (root, dirs, files) in walkdir('.') A custom error handling function can be provided through onerror keyword argument. If walkdir or stat encounters a IOError it will rethrow the error by default. The directory tree can be traversed top-down or bottom-up. The iterator returns a tuple containing (rootpath, dirs, files). Return an iterator that walks the directory tree of a directory. Walkdir(dir topdown=true, follow_symlinks=false, onerror=throw) '/home/JuliaUser/dev/julia/base/weakkeydict.jl' source - Function '/home/JuliaUser/dev/julia/base/views.jl' '/home/JuliaUser/dev/julia/base/version_git.sh' '/home/JuliaUser/dev/julia/base/Enums.jl' '/home/JuliaUser/dev/julia/base/.gitignore' Julia> readdir(abspath('base'), join=true) '/home/JuliaUser/dev/julia/.gitattributes' '/home/JuliaUser/dev/julia/.appveyor.yml' The join and sort keyword arguments require at least Julia 1.4.Įxamples julia> cd('/home/JuliaUser/dev/julia')