Files from glob string?

58 views
Skip to first unread message

Scott Royston

unread,
Oct 20, 2011, 11:12:10 PM10/20/11
to scala-i...@googlegroups.com
I've been poking around the documentation, and it's not obvious to me how I can get a list of files from a glob string.

For instance if I have something like:

val myglobString = "/home/foo/some/path/to/files/*.xml"

What's the most direct way to get a list of files?

I know I can do this:
val pathSet = "/home" / "foo" / "some" / "path" / "to" / "files" * "*.xml"
pathSet.collect { case filePath: DefaultPath => filePath.jfile }

But I'm not sure how to do it with an 'unparsed' string.  Any pointers?

Thanks!

Reply all
Reply to author
Forward
0 new messages