equal
deleted
inserted
replaced
140 finally { in.close } |
140 finally { in.close } |
141 } |
141 } |
142 } |
142 } |
143 |
143 |
144 def copy(path1: Path, path2: Path): Unit = copy(path1.file, path2.file) |
144 def copy(path1: Path, path2: Path): Unit = copy(path1.file, path2.file) |
145 |
|
146 |
|
147 /* tmp files */ |
|
148 |
|
149 def tmp_file(prefix: String): JFile = |
|
150 { |
|
151 val file = JFile.createTempFile(prefix, null) |
|
152 file.deleteOnExit |
|
153 file |
|
154 } |
|
155 |
|
156 def with_tmp_file[A](prefix: String)(body: JFile => A): A = |
|
157 { |
|
158 val file = tmp_file(prefix) |
|
159 try { body(file) } finally { file.delete } |
|
160 } |
|
161 } |
145 } |
162 |
146 |