* @return String
   */
  public static String directoryFileName(String directory) {
    { char separator = Stella.directorySeparatorForFile(directory);
      int last = directory.length() - 1;

      if ((last >= 0) &&
          (directory.charAt(last) == separator)) {
        return (Native.string_subsequence(directory, 0, last));
      }
      else {
        return (directory);
      }
    }
  }