anchor.diff:    return outputId;
   }
   
  -void _writeAsBytes(Directory outputDir, AssetId id, List<int> bytes) {
  -  var file = _fileFor(outputDir, id);
  -  file.writeAsBytesSync(bytes);
  -}
  -
  -void _writeAsString(Directory outputDir, AssetId id, String contents) {
  -  var file = _fileFor(outputDir, id);
  -  file.writeAsStringSync(contents);
  -}
  -
  -File _fileFor(Directory outputDir, AssetId id) {
  +Future<void> _writeAsBytes(Directory outputDir, AssetId id, List<int> bytes) =>
  +    _descriptorPool.withResource(
  +        () => _fileFor(outputDir, id).then((file) => file.writeAsBytes(bytes)));
  +
  +Future<void> _writeAsString(Directory outputDir, AssetId id, String contents) =>
  +    _descriptorPool.withResource(() =>
  +        _fileFor(outputDir, id).then((file) => file.writeAsString(contents)));
  +
  +Future<File> _fileFor(Directory outputDir, AssetId id) {
     String relativePath;
     if (id.path.startsWith('lib')) {
       relativePath =
  
positive.code:   } else {
      relativePath = id.path;
    }
    var file = new File(p.join(outputDir.path, relativePath));
    file.createSync(recursive: true);
    return file;
  }
  
  /// Checks for a manifest file in [outputDir] and deletes all referenced files.
  
negative.code: import '../environment/build_environment.dart';
  import '../logging/logging.dart';
  import '../package_graph/package_graph.dart';
  
  /// Pool for async file operations, we don't want to use too many file handles.
  final _descriptorPool = new Pool(32);
  
  final _logger = new Logger('CreateOutputDir');
  const _manifestName = '.build.manifest';
  