Search for files in a folder

In Julia, the equivalent to list.files() is readdir([path])

There is no built-in directory search that I know of, but it is a one-liner:

searchdir(path,key) = filter(x->contains(x,key), readdir(path))


UPDATE: Since at least Julia v0.7, contains() has been deprecated for occursin(substring, string). So the above filter would now be:

searchdir(path,key) = filter(x->occursin(key,x), readdir(path))

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)