Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > FileSystem > createSymbolicLinkFile

FileSystem.createSymbolicLinkFile() method

Creates a symbolic link to a file. On Windows operating systems, this may require administrator elevation. Behind the scenes it uses fs.symlinkSync().

Signature:

static createSymbolicLinkFile(options: IFileSystemCreateLinkOptions): void;

Parameters

ParameterTypeDescription
optionsIFileSystemCreateLinkOptions

Returns:

void

Remarks

To avoid administrator elevation on Windows, use FileSystem.createHardLink() instead.

On Windows operating systems, the NTFS file system distinguishes file symlinks versus directory symlinks: If the target is not the correct type, the symlink will be created successfully, but will fail to resolve. Other operating systems do not make this distinction, in which case FileSystem.createSymbolicLinkFile() and FileSystem.createSymbolicLinkFolder() can be used interchangeably, but doing so will make your tool incompatible with Windows.