anchor.diff:      );
   
       for (String import in _fileDescriptor.dependency) {
  -      Path relativeProtoPath =
  -          new Path(import).relativeTo(directoryPath).canonicalize();
  +      Uri importPath = new Uri.file(import);
  +      if (importPath.isAbsolute) {
  +        // protoc should never generate an import with an absolute path.
  +        throw("FAILURE: Import with absolute path is not supported");
  +      }
  +      // Create a relative path from the current file to the import.
  +      Uri relativeProtoPath = _relative(importPath, filePath);
         out.println("import '${_generatedFilePath(relativeProtoPath)}';");
       }
       out.println('');
  
positive.code:   String get fqname => _fileDescriptor.package == null
        ? '' : '.${_fileDescriptor.package}';
  
    _generatedFilePath(Path path) {
      Path withoutExtension = path.directoryPath
          .join(new Path(path.filenameWithoutExtension));
      return '${withoutExtension.toNativePath()}.pb.dart';
    }
  
    CodeGeneratorResponse_File generateResponse() {
  
negative.code: 
      generate(out);
  
      Uri filePath = new Uri(scheme: 'file', path: _fileDescriptor.name);
      return new CodeGeneratorResponse_File()
          ..name = _generatedFilePath(filePath).path
          ..content = writer.toString();
    }
  
    void generate(IndentingWriter out) {
      Uri filePath = new Uri.file(_fileDescriptor.name);
      if (filePath.isAbsolute) {
          // protoc should never generate an file descriptor an absolute path.
          throw("FAILURE: file with absolute path is not supported");
      }
  
      String className = _generateClassName(filePath);
  
      String libraryName = className + '.pb';
  
  