C# Class DotNetIO.FileSystems.Local.Win32.Interop.JunctionPoint

Provides access to NTFS junction points in .Net.
显示文件 Open project: DotNetIO/DotNetIO

Public Methods

Method Description
Create ( Directory junctionPoint, string targetDir, bool overwrite ) : void

Creates a junction point from the specified directory to the specified target directory.

Only works on NTFS.

Delete ( Path junctionPoint ) : void

Deletes a junction point at the specified source directory along with the directory itself. Does nothing if the junction point does not exist.

Only works on NTFS.

Exists ( Path path ) : bool

Determines whether the specified path exists and refers to a junction point.

GetTarget ( Path junctionPoint ) : Path

Gets the target of the specified junction point.

Only works on NTFS.

Private Methods

Method Description
CreateFile ( string lpFileName, EFileAccess dwDesiredAccess, EFileShare dwShareMode, IntPtr lpSecurityAttributes, ECreationDisposition dwCreationDisposition, EFileAttributes dwFlagsAndAttributes, IntPtr hTemplateFile ) : IntPtr
DeviceIoControl ( IntPtr hDevice, uint dwIoControlCode, IntPtr InBuffer, int nInBufferSize, IntPtr OutBuffer, int nOutBufferSize, int &pBytesReturned, IntPtr lpOverlapped ) : bool
InternalGetTarget ( SafeFileHandle handle ) : string
OpenReparsePoint ( Path reparsePoint, EFileAccess accessMode ) : SafeFileHandle
ThrowLastWin32Error ( string message ) : void

Method Details

Create() public static method

Creates a junction point from the specified directory to the specified target directory.
Only works on NTFS.
Thrown when the junction point could not be created or when /// an existing directory was found and if false
public static Create ( Directory junctionPoint, string targetDir, bool overwrite ) : void
junctionPoint System.IO.Directory The junction point path
targetDir string The target directory
overwrite bool If true overwrites an existing reparse point or empty directory
return void

Delete() public static method

Deletes a junction point at the specified source directory along with the directory itself. Does nothing if the junction point does not exist.
Only works on NTFS.
public static Delete ( Path junctionPoint ) : void
junctionPoint System.IO.Path The junction point path
return void

Exists() public static method

Determines whether the specified path exists and refers to a junction point.
Thrown if the specified path is invalid /// or some other error occurs
public static Exists ( Path path ) : bool
path System.IO.Path The junction point path
return bool

GetTarget() public static method

Gets the target of the specified junction point.
Only works on NTFS.
Thrown when the specified path does not /// exist, is invalid, is not a junction point, or some other error occurs
public static GetTarget ( Path junctionPoint ) : Path
junctionPoint System.IO.Path The junction point path
return System.IO.Path