Scala Programming Language
  1. Scala Programming Language
  2. SI-4733

fsc creates /tmp/scala-devel folder writable only by owner (drwxr-xr-x)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.0
    • Fix Version/s: Scala 2.10.1
    • Component/s: Misc Compiler
    • Labels:
    • Environment:

      Scala code runner version 2.9.0.1 – Copyright 2002-2011, LAMP/EPFL

      Description

      When invoking fsc by the compilation of a script fsc creates a /tmp/scala-devel directory that is writable only by the user.
      A second user is not able to compile his scripts on the same machine. She gets the error: "Could not find a directory for temporary files".

      in CompileSocket.scala

      /** A temporary directory to use */
      val tmpDir = {
      val udir = Option(Properties.userName) getOrElse "shared"
      val f = (Path(Properties.tmpDir) / "scala-devel" / udir).createDirectory()

      if (f.isDirectory && f.canWrite)

      { info("[Temp directory: " + f + "]") f }

      else fatal("Could not find a directory for temporary files")
      }

      adding something like:
      new java.io.File(Path(Properties.tmpDir) / "scala-devel").setWritable(true,false)
      would maybe help.

      see also this thread:
      http://scala-programming-language.1934581.n4.nabble.com/fsc-Error-when-compiling-on-a-shared-machine-td3163377.html

        Activity

        Hide
        idot added a comment -

        easier would be to get rid of common machine level folder and create only user specific folders.

        val f = (Path(Properties.tmpDir) / "scala-devel-" + udir).createDirectory()

        Show
        idot added a comment - easier would be to get rid of common machine level folder and create only user specific folders. val f = (Path(Properties.tmpDir) / "scala-devel-" + udir).createDirectory()
        Hide
        Cody Mello added a comment -
        Show
        Cody Mello added a comment - I made a change to fix this here: https://github.com/melloc/scala/commit/1630fe98ce3a78c3bca773db4d4eee5baea98d38
        Hide
        Cody Mello added a comment -
        Show
        Cody Mello added a comment - Merge into the 2.10.x branch: https://github.com/scala/scala/commit/d4de6f4cc6c3f0f9d7810c6e9a10147a0406e3f5

          People

          • Assignee:
            Cody Mello
            Reporter:
            idot
          • Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development