C# Class WindowsPathUnitTest.JunctionPoint

Provides access to NTFS junction points in .Net.
Afficher le fichier Open project: nemec/pathlib Class Usage Examples

Méthodes publiques

Méthode Description
Create ( string junctionPoint, string targetDir, bool overwrite ) : void

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

Only works on NTFS.

Delete ( string 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 ( string path ) : bool

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

GetTarget ( string junctionPoint ) : string

Gets the target of the specified junction point.

Only works on NTFS.

Private Methods

Méthode 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 ( string reparsePoint, EFileAccess accessMode ) : SafeFileHandle
ThrowLastWin32Error ( string message ) : void

Method Details

Create() public static méthode

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 ( string junctionPoint, string targetDir, bool overwrite ) : void
junctionPoint string The junction point path
targetDir string The target directory
overwrite bool If true overwrites an existing reparse point or empty directory
Résultat void

Delete() public static méthode

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 ( string junctionPoint ) : void
junctionPoint string The junction point path
Résultat void

Exists() public static méthode

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 ( string path ) : bool
path string The junction point path
Résultat bool

GetTarget() public static méthode

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 ( string junctionPoint ) : string
junctionPoint string The junction point path
Résultat string