create_symlink Function

Creates a symbolic link to an existing file.

 void create_sym_link(
   const path1& Pval1,
   const path2& Pval2
);
inline error_code create_sym_link(
   const path1& Pval1,
   const path2& Pval2,
   error_code& Code
);

Parameters

  • Pval1
    A path object that represents the file name of an existing file.

  • Pval2
    A path object that contains the file name of the symbolic link.

  • Code
    An error_code object.

Return Value

The second function returns Code.

Remarks

A symbolic link is a file system object that points to another file system object.

If the symbolic link cannot be created, the first function throws a filesystem_error.

The second function assigns to Code any error code that's associated with the operation.

Requirements

Header: filesystem

Namespace: std::tr2::sys

See Also

Reference

<filesystem>

Other Resources

C++ Standard Library Header Files