Skip to contents

Replace given filename by a version that contains an incremental number in order to prevent overwriting existing files.

Usage

ensure_unique_filename(path, add_num = TRUE)

Arguments

path

string; Filename including path for which to check uniqueness.

add_num

boolean; if TRUE, add the incremental number anyways, even if no filename conflict exists.

Value

A unique filename.