Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: lib/src/io.dart

Issue 1564653002: Work around dart-lang/sdk#25353. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /// Helper functionality to make working with IO easier. 5 /// Helper functionality to make working with IO easier.
6 library pub.io; 6 library pub.io;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection'; 9 import 'dart:collection';
10 import 'dart:convert'; 10 import 'dart:convert';
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 340
341 getErrorReason(error) { 341 getErrorReason(error) {
342 if (error.osError.errorCode == 5) { 342 if (error.osError.errorCode == 5) {
343 return "access was denied"; 343 return "access was denied";
344 } 344 }
345 345
346 if (error.osError.errorCode == 32) { 346 if (error.osError.errorCode == 32) {
347 return "it was in use by another process"; 347 return "it was in use by another process";
348 } 348 }
349 349
350 if (error.osError.errorCode == 145) {
351 return "of dart-lang/sdk#25353";
352 }
353
350 return null; 354 return null;
351 } 355 }
352 356
353 for (var i = 0; i < 2; i++) { 357 for (var i = 0; i < 2; i++) {
354 try { 358 try {
355 operation(); 359 operation();
356 return; 360 return;
357 } on FileSystemException catch (error) { 361 } on FileSystemException catch (error) {
358 var reason = getErrorReason(error); 362 var reason = getErrorReason(error);
359 if (reason == null) rethrow; 363 if (reason == null) rethrow;
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 1065
1062 // TODO(rnystrom): Remove this and change to returning one string. 1066 // TODO(rnystrom): Remove this and change to returning one string.
1063 static List<String> _toLines(String output) { 1067 static List<String> _toLines(String output) {
1064 var lines = splitLines(output); 1068 var lines = splitLines(output);
1065 if (!lines.isEmpty && lines.last == "") lines.removeLast(); 1069 if (!lines.isEmpty && lines.last == "") lines.removeLast();
1066 return lines; 1070 return lines;
1067 } 1071 }
1068 1072
1069 bool get success => exitCode == exit_codes.SUCCESS; 1073 bool get success => exitCode == exit_codes.SUCCESS;
1070 } 1074 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698