[scala-user] scala.bat (and other .bat tools) cannot process path with space properly

61 views
Skip to first unread message

Hyunsok Oh

unread,
Nov 13, 2015, 9:12:43 AM11/13/15
to scala-user
Hi guys,

There are Korean scala group and there was a post about why the scala REPL or compiler cannot deal with the source path with space properly(Of course, in Windows). I've checked the problem and found that the batch file has some error checking the paths with spaces. e.g.

D:\x\dir with space> dir
 Volume in drive D is data
 Volume Serial Number is 0268-BDFF

 Directory of D:\x\dir with space

13/11/2015  11:18 PM    <DIR>          .
13/11/2015  11:18 PM    <DIR>          ..
13/11/2015  11:18 PM                26 test.scala
               1 File(s)             26 bytes
               2 Dir(s)  89,412,505,600 bytes free

D:\x\dir with space>scala -version
Scala code runner version 2.11.7 -- Copyright 2002-2013, LAMP/EPFL

D:\x\dir with space>scala "D:\x\dir with space\test.scala"
with was unexpected at this time.

D:\x\dir with space>scalac "D:\x\dir with space\test.scala"
with was unexpected at this time.

I found that this is because of the test of %1(first commandline arg) with "-testcp".

The batchfile has:

if not [%~1]==[-toolcp] (
  goto :notoolcp
)

and the test [%~1]==[~toolcp] is not working on my windows PC.

This issues is in issues.scala-lang.org already(SI-7821) and status is "closed".
But I think we should re-open that.

Regards,

- Sean

Seth Tisue

unread,
Nov 20, 2015, 11:19:18 AM11/20/15
to scala-user
I see SI-7821 has a suggested fix. Would you like to make it into a pull request?

Reply all
Reply to author
Forward
0 new messages