-5
내 D:/work
폴더를 사용하여 스칼라 분할 방식으로 파일과 디렉토리의 수를 얻기 위해 노력하고있어,하지만 난 오류를 가진스칼라
import java.io._
val fd = (new File("D:/work/")).listFiles
scala> fd.partition (x => {case x.isFile() => "FILE"; case x.isDirectory() => "DIR" })
<console>:28: error: missing parameter type for expanded function
The argument types of an anonymous function must be fully known. (SLS 8.5)
Expected type was: Boolean
fd.partition (x => {case x.isFile() => "FILE"; case x.isDirectory() => "DIR" })
^
<console>:28: error: method isFile is not a case class, nor does it have an unapply/unapplySeq member
fd.partition (x => {case x.isFile() => "FILE"; case x.isDirectory() => "DIR" })
^
<console>:28: error: method isDirectory is not a case class, nor does it have an unapply/unapplySeq member
fd.partition (x => {case x.isFile() => "FILE"; case x.isDirectory() => "DIR" })
^
scala>