- About Scala
- In the Enterprise
- Scala Community
- Language Research
- In the Press
- The Scala Team
- Scala's Prehistory
- Contact Us
- Learning Scala
- Tour of Scala
- Scala API
- Setup & Getting Started
- Programming Guides
- Other Guides
- Code Examples
- Scala Developers
Tue, 2010-06-08, 09:28
Since the changeset #21323, garbage files named as bug60503430*.tmp
will be generated in the tmp directory, whenever running scala programs.
It is not so nice, IMHO.
File.scala has the following code,
// this is a workaround for
// we are using a static initializer to statically initialize a java
class so we don't
// trigger java.lang.InternalErrors later when using it concurrently.
val tmp = JFile.createTempFile("bug6503430", null, null)
val in = new FileInputStream(tmp).getChannel()
val out = new FileOutputStream(tmp, true).getChannel()
out.transferFrom(in, 0, 0)
I'm not familiar with JDK bug #6503430, but is it impossible to
delete that tmp file after calling tranferFrom method?
That bug entry has the following comment,
CUSTOMER SUBMITTED WORKAROUND :
Before starting your application, add a single-threaded piece of code that
calls FileChannel.transferFrom() from another FileChannel to ensure that
the initialization is done correctly. After that, all subsequent
invocations will work fine.
It seems to me that there is no problem to delete tmp file after the
by FileChannel.tranferFrom(), according to that comment.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.