DirectoryCreateJunction Method (String, String, Boolean, Boolean, PathFormat) |
[AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
Remarks
The directory must be empty and reside on a local volume.
MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
and a junction can link directories located on different local volumes on the same computer.
Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
Namespace:
Alphaleonis.Win32.Filesystem
Assembly:
AlphaFS (in AlphaFS.dll) Version: 2.2
Syntax public static void CreateJunction(
string junctionPath,
string directoryPath,
bool overwrite,
bool copyTargetTimestamps,
PathFormat pathFormat
)
Public Shared Sub CreateJunction (
junctionPath As String,
directoryPath As String,
overwrite As Boolean,
copyTargetTimestamps As Boolean,
pathFormat As PathFormat
)
public:
static void CreateJunction(
String^ junctionPath,
String^ directoryPath,
bool overwrite,
bool copyTargetTimestamps,
PathFormat pathFormat
)
static member CreateJunction :
junctionPath : string *
directoryPath : string *
overwrite : bool *
copyTargetTimestamps : bool *
pathFormat : PathFormat -> unit
Parameters
- junctionPath
- Type: SystemString
The path of the junction point to create. - directoryPath
- Type: SystemString
The path to the directory. If the directory does not exist it will be created. - overwrite
- Type: SystemBoolean
to overwrite an existing junction point. The directory is removed and recreated. - copyTargetTimestamps
- Type: SystemBoolean
to copy the target date and time stamps to the directory junction. - pathFormat
- Type: Alphaleonis.Win32.FilesystemPathFormat
Indicates the format of the path parameter(s).
Exceptions See Also