Beispiel #1
0
  /**
   * Creates the last element of the path, unless recursive = TRUE. Trailing path separators are
   * removed.
   *
   * @param context the current call Context
   * @param path the path
   * @param showWarnings should the warnings on failure be shown?
   * @param recursive Should elements of the path other than the last be created? If true, like
   *     Unix's mkdir -p
   * @param mode the file mode to be used on Unix-alikes: it will be coerced by as.octmode.
   *     (currently ignored by renjin)
   * @return true if the operation succeeded for each of the files attempted. Using a missing value
   *     for a path name will always be regarded as a failure. returns false if the directory
   *     already exists
   * @throws FileSystemException
   */
  @Internal("dir.create")
  public static SEXP dirCreate(
      @Current Context context, String path, boolean showWarnings, boolean recursive, int mode)
      throws FileSystemException {
    FileObject dir = context.resolveFile(path);
    dir.createFolder();

    // TODO: return correct value and implement warnings documented above

    context.setInvisibleFlag();
    return new LogicalArrayVector(true);
  }