public static String rerootFileName(String file, String fromroot, String toroot) {
    { boolean absoluteP = Native.stringSearch(file, fromroot, 0) == 0;

      if (absoluteP) {
        if (Stella.stringEqlP(fromroot, toroot)) {
          return (file);
        }
        else {
          return (toroot + Native.string_subsequence(file, fromroot.length(), Stella.NULL_INTEGER));
        }
      }
      else {
        return (toroot + file);
      }
    }
  }