Share via


ReparsePointAware.PinHandle(String, Boolean) Method

Definition

Takes a handle on an existing file or directory to ensure that it cannot move.

public static Microsoft.Win32.SafeHandles.SafeFileHandle PinHandle (string fullPath, bool asDirectory);
static member PinHandle : string * bool -> Microsoft.Win32.SafeHandles.SafeFileHandle
Public Shared Function PinHandle (fullPath As String, asDirectory As Boolean) As SafeFileHandle

Parameters

fullPath
String

Full path to the target file or directory.

asDirectory
Boolean

Whether the request is on a directory or file.

Returns

SafeFileHandle to the object referenced by fullPath.

Exceptions

Failed to open the handle either because the file or directory did not exist or because the current user has no access.

Applies to