OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_node'); | 5 #library('file_system_node'); |
6 | 6 |
7 #import('file_system.dart'); | 7 #import('file_system.dart'); |
8 #import('lib/node/node.dart'); | 8 #import('lib/node/node.dart'); |
| 9 #import('lib/node/fs.dart'); |
| 10 #import('lib/node/path.dart'); |
9 | 11 |
10 /** File system implementation using nodejs api's (for self-hosted compiler). */ | 12 /** File system implementation using nodejs api's (for self-hosted compiler). */ |
11 class NodeFileSystem implements FileSystem { | 13 class NodeFileSystem implements FileSystem { |
12 void writeString(String outfile, String text) { | 14 void writeString(String outfile, String text) { |
13 fs.writeFileSync(outfile, text); | 15 fs.writeFileSync(outfile, text); |
14 } | 16 } |
15 | 17 |
16 String readAll(String filename) { | 18 String readAll(String filename) { |
17 return fs.readFileSync(filename, 'utf8'); | 19 return fs.readFileSync(filename, 'utf8'); |
18 } | 20 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } else if (stat.isFile()) { | 76 } else if (stat.isFile()) { |
75 // Try to remove the file. | 77 // Try to remove the file. |
76 fs.unlinkSync(subpath); | 78 fs.unlinkSync(subpath); |
77 } | 79 } |
78 } | 80 } |
79 } | 81 } |
80 | 82 |
81 fs.rmdirSync(path); | 83 fs.rmdirSync(path); |
82 } | 84 } |
83 } | 85 } |
OLD | NEW |