| Index: runtime/bin/directory_impl.dart
|
| diff --git a/runtime/bin/directory_impl.dart b/runtime/bin/directory_impl.dart
|
| index ee4cbaa9c04282743e4d22ff3b1f4e0803a1a256..e87cb540c64eb1911cdba87fc4bc575bf3531f5f 100644
|
| --- a/runtime/bin/directory_impl.dart
|
| +++ b/runtime/bin/directory_impl.dart
|
| @@ -36,12 +36,10 @@ class _DirectoryCreateTempIsolate extends Isolate {
|
| void main() {
|
| port.receive((path, replyTo) {
|
| // Call function to get file name
|
| - replyTo.send(_createTemp(path, (Math.random() * 0x8000000).toInt()));
|
| + replyTo.send(_Directory._createTemp(path, (Math.random() * 0x8000000).toInt()));
|
| port.close();
|
| });
|
| }
|
| -
|
| - String _createTemp(String template, int num) native "Directory_CreateTemp";
|
| }
|
|
|
|
|
| @@ -49,6 +47,8 @@ class _Directory implements Directory {
|
|
|
| _Directory(String this._path);
|
|
|
| + static String _createTemp(String template, int num) native "Directory_CreateTemp";
|
| +
|
| bool existsSync() {
|
| int exists = _exists(_path);
|
| if (exists < 0) {
|
| @@ -80,6 +80,15 @@ class _Directory implements Directory {
|
| });
|
| }
|
|
|
| + void createTempSync() {
|
| + var result = _createTemp(path, (Math.random() * 0x8000000).toInt());
|
| + if (result != '') {
|
| + _path = result;
|
| + } else {
|
| + throw "createTempSync failed";
|
| + }
|
| + }
|
| +
|
| void deleteSync() {
|
| if (!_delete(_path)) {
|
| throw new DirectoryException("Directory deletion failed: $_path");
|
|
|