diff options
author | Paul Phillips <paulp@improving.org> | 2009-06-24 20:54:18 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-06-24 20:54:18 +0000 |
commit | 24781591253de7a9f54a3fc7bcf6ae4b3e969098 (patch) | |
tree | f9b63c0fd117c2da79c378cbb8eda2869274d326 /src/library/scala/util/Properties.scala | |
parent | f537546d8b32d06e9d9a921a47bb75f1b1f7ecfa (diff) | |
download | scala-24781591253de7a9f54a3fc7bcf6ae4b3e969098.tar.gz scala-24781591253de7a9f54a3fc7bcf6ae4b3e969098.tar.bz2 scala-24781591253de7a9f54a3fc7bcf6ae4b3e969098.zip |
Skeletal implementation of scala.io.File.
Separated default source code encoding (the one specified by -encoding)
from default system encoding, because otherwise you can't compile scala
with the defaults on OSX.
Diffstat (limited to 'src/library/scala/util/Properties.scala')
-rw-r--r-- | src/library/scala/util/Properties.scala | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/library/scala/util/Properties.scala b/src/library/scala/util/Properties.scala index 8f45c2b388..fb4ecbbd90 100644 --- a/src/library/scala/util/Properties.scala +++ b/src/library/scala/util/Properties.scala @@ -47,15 +47,22 @@ private[scala] trait PropertiesTrait def prop(name: String): String = props.getProperty(name, "") def prop(name: String, default: String): String = props.getProperty(name, default) - // XXX file.encoding should not be here, as it causes system setting to - // be ignored. See https://lampsvn.epfl.ch/trac/scala/ticket/1581 - /** The version number of the jar this was loaded from plus "version " prefix, * or "version (unknown)" if it cannot be determined. */ val versionString = "version " + prop("version.number", "(unknown)") val copyrightString = prop("copyright.string", "(c) 2002-2009 LAMP/EPFL") - val encodingString = prop("file.encoding", "UTF8") + + /** This is the encoding to use reading in source files, overridden with -encoding + * Note that it uses "prop" i.e. looks in the scala jar, not the system properties. + */ + val sourceEncoding = prop("file.encoding", "UTF8") + + /** This is the default text encoding, overridden (unreliably) with + * JAVA_OPTS="-Dfile.encoding=Foo" + */ + val encodingString = sysprop("file.encoding", "UTF8") + val isWin = sysprop("os.name") startsWith "Windows" val isMac = sysprop("java.vendor") startsWith "Apple" val javaClassPath = sysprop("java.class.path") @@ -64,6 +71,7 @@ private[scala] trait PropertiesTrait val javaVmVersion = sysprop("java.vm.version") val javaVmInfo = sysprop("java.vm.info") val javaVersion = sysprop("java.version") + val tmpDir = sysprop("java.io.tmpdir") val scalaHome = sysprop("scala.home", null) // XXX places do null checks... // provide a main method so version info can be obtained by running this |