OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #library('file_system_vm'); | 5 #library('file_system_vm'); |
| 6 #import('dart:io'); |
6 #import('file_system.dart'); | 7 #import('file_system.dart'); |
7 | 8 |
8 /** File system implementation using the vm api's. */ | 9 /** File system implementation using the vm api's. */ |
9 class VMFileSystem implements FileSystem { | 10 class VMFileSystem implements FileSystem { |
10 void writeString(String outfile, String text) { | 11 void writeString(String outfile, String text) { |
11 var f = new File(outfile); | 12 var f = new File(outfile); |
12 var stream = f.openOutputStream(); | 13 var stream = f.openOutputStream(); |
13 stream.write(text.charCodes()); | 14 stream.write(text.charCodes()); |
14 stream.close(); | 15 stream.close(); |
15 } | 16 } |
(...skipping 14 matching lines...) Expand all Loading... |
30 void createDirectory(String path, [bool recursive = false]) { | 31 void createDirectory(String path, [bool recursive = false]) { |
31 // TODO(rnystrom): Implement. | 32 // TODO(rnystrom): Implement. |
32 throw 'createDirectory() is not implemented by VMFileSystem yet.'; | 33 throw 'createDirectory() is not implemented by VMFileSystem yet.'; |
33 } | 34 } |
34 | 35 |
35 void removeDirectory(String path, [bool recursive = false]) { | 36 void removeDirectory(String path, [bool recursive = false]) { |
36 // TODO(rnystrom): Implement. | 37 // TODO(rnystrom): Implement. |
37 throw 'removeDirectory() is not implemented by VMFileSystem yet.'; | 38 throw 'removeDirectory() is not implemented by VMFileSystem yet.'; |
38 } | 39 } |
39 } | 40 } |
OLD | NEW |