anchor.diff:  }
   
   void testCreateInNonExistentDirectory() {
  -  var file = new File("${tempDir().path}/nonExistentDirectory/newFile");
  +  Directory temp = tempDir();
  +  ReceivePort p = new ReceivePort();
  +  p.receive((x, y) {
  +    p.close();
  +    temp.deleteRecursivelySync();
  +  });
  +  var file = new File("${temp.path}/nonExistentDirectory/newFile");
   
     // Create in non-existent directory should throw exception.
     Expect.throws(() => file.createSync(),
                   (e) => checkCreateInNonExistentDirectoryException(e));
   
     file.create(() => Expect.fail("Unreachable code"));
  -  file.onError = (e) => checkCreateInNonExistentDirectoryException(e);
  +  file.onError = (e) {
  +    checkCreateInNonExistentDirectoryException(e);
  +    p.toSendPort().send(null);
  +  };
   }
   
   bool checkFullPathOnNonExistentDirectoryException(e) {
  
positive.code: }
  
  void testDirectoryInNonExistentDirectory() {
    var file = new File("${tempDir().path}/nonExistentDirectory/newFile");
  
    // Create in non-existent directory should throw exception.
    Expect.throws(() => file.directorySync(),
                  (e) => checkDirectoryInNonExistentDirectoryException(e));
  
    file.directory((directory) => Expect.fail("Unreachable code"));
    file.onError = (e) => checkDirectoryInNonExistentDirectoryException(e);
  }
  
  void testReadAsBytesNonExistent() {
    var file = new File("${tempDir().path}/nonExistentFile3");
  
    // Non-existing file should throw exception.
    Expect.throws(() => file.readAsBytesSync(),
                  (e) => checkOpenNonExistentFileException(e));
  
    file.readAsBytes((data) => Expect.fail("Unreachable code"));
    file.onError = (e) => checkOpenNonExistentFileException(e);
  }
  
  void testReadAsTextNonExistent() {
    var file = new File("${tempDir().path}/nonExistentFile4");
  
    // Non-existing file should throw exception.
    Expect.throws(() => file.readAsTextSync(),
                  (e) => checkOpenNonExistentFileException(e));
  
    file.readAsText(Encoding.ASCII, (data) => Expect.fail("Unreachable code"));
    file.onError = (e) => checkOpenNonExistentFileException(e);
  }
  
  void testReadAsLinesNonExistent() {
    var file = new File("${tempDir().path}/nonExistentFile5");
  
    // Non-existing file should throw exception.
    Expect.throws(() => file.readAsLinesSync(),
                  (e) => checkOpenNonExistentFileException(e));
  
    file.readAsLines(Encoding.ASCII, (data) => Expect.fail("Unreachable code"));
    file.onError = (e) => checkOpenNonExistentFileException(e);
  }
  
  bool checkWriteReadOnlyFileException(e) {
  
negative.code: testTruncateReadOnlyFile() {
    Directory temp = tempDir();
    ReceivePort p = new ReceivePort();
    p.receive((x, y) {
      p.close();
      temp.deleteRecursivelySync();
    });
  