trim_paths function

Trim a vector of filesystem paths.