| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 // Read the file in blocks of size 64k. | 7 // Read the file in blocks of size 64k. |
| 8 const int _BLOCK_SIZE = 64 * 1024; | 8 const int _BLOCK_SIZE = 64 * 1024; |
| 9 | 9 |
| 10 | 10 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 return _fileService.call(request).then((response) { | 318 return _fileService.call(request).then((response) { |
| 319 if (_isErrorResponse(response)) { | 319 if (_isErrorResponse(response)) { |
| 320 throw _exceptionFromResponse(response, "Cannot delete file '$_path'"); | 320 throw _exceptionFromResponse(response, "Cannot delete file '$_path'"); |
| 321 } | 321 } |
| 322 return this; | 322 return this; |
| 323 }); | 323 }); |
| 324 } | 324 } |
| 325 | 325 |
| 326 external static _delete(String path); | 326 external static _delete(String path); |
| 327 | 327 |
| 328 external static _deleteLink(String path); |
| 329 |
| 328 void deleteSync() { | 330 void deleteSync() { |
| 329 var result = _delete(_path); | 331 var result = _delete(_path); |
| 330 throwIfError(result, "Cannot delete file '$_path'"); | 332 throwIfError(result, "Cannot delete file '$_path'"); |
| 331 } | 333 } |
| 332 | 334 |
| 333 Future<Directory> directory() { | 335 Future<Directory> directory() { |
| 334 _ensureFileService(); | 336 _ensureFileService(); |
| 335 List request = new List(2); | 337 List request = new List(2); |
| 336 request[0] = _DIRECTORY_REQUEST; | 338 request[0] = _DIRECTORY_REQUEST; |
| 337 request[1] = _path; | 339 request[1] = _path; |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 new FileIOException("File closed '$_path'")); | 1054 new FileIOException("File closed '$_path'")); |
| 1053 }); | 1055 }); |
| 1054 return completer.future; | 1056 return completer.future; |
| 1055 } | 1057 } |
| 1056 | 1058 |
| 1057 final String _path; | 1059 final String _path; |
| 1058 int _id; | 1060 int _id; |
| 1059 | 1061 |
| 1060 SendPort _fileService; | 1062 SendPort _fileService; |
| 1061 } | 1063 } |
| OLD | NEW |