0

We have existing files with "&" in file names and want to use java.io.File, for instance the method list(). In this case, list doesn't return the directory entries. Escaping "&" with "\&" doesn't help. Thank you.

Julia
  • 318
  • 1
  • 5
  • 14

1 Answers1

3

It works fine for me on Mac OSX. Please post your code illustrating the problem.

$ touch a\&b
$ touch c\ \&b
$ ls
a&b  c &b
$ scala
scala> import java.io.File
import java.io.File

scala> new File(".").list()
res0: Array[java.lang.String] = Array(a&b, c &b)
I82Much
  • 26,901
  • 13
  • 88
  • 119