RoadmapShopEvents
Skip to main content

Home > @rushstack/node-core-library > AlreadyExistsBehavior

AlreadyExistsBehavior enum

Specifies the behavior of APIs such as FileSystem.copyFile() or FileSystem.createSymbolicLinkFile() when the output file path already exists.

Signature:
export declare enum AlreadyExistsBehavior

Enumeration Members

MemberValueDescription
Error"error"If the output file path already exists, the operation will fail, and an error will be reported.
Ignore"ignore"If the output file path already exists, skip this item, and continue the operation.
Overwrite"overwrite"If the output file path already exists, try to overwrite the existing object.

Remarks

For FileSystem.copyFile() and related APIs, the "output file path" is IFileSystemCopyFileOptions.destinationPath .

For FileSystem.createSymbolicLinkFile() and related APIs, the "output file path" is IFileSystemCreateLinkOptions.newLinkPath .