ReparsePointAware.PinAndRequireNoReparsePoints(String, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Opens a SafeFileHandle to an existing file or directory and confirms that the resulting canonical path matches that of the given path. The resulting SafeFileHandle is IDisposable and can be used within using statements to ensure that subsequent file operations are writing to paths without reparse points.
public static Microsoft.Win32.SafeHandles.SafeFileHandle PinAndRequireNoReparsePoints (string expectedPath, bool asDirectory);
static member PinAndRequireNoReparsePoints : string * bool -> Microsoft.Win32.SafeHandles.SafeFileHandle
Public Shared Function PinAndRequireNoReparsePoints (expectedPath As String, asDirectory As Boolean) As SafeFileHandle
Parameters
- expectedPath
- String
Expected path to pin.
- asDirectory
- Boolean
Whether it is a file or directory path.
Returns
SafeFileHandle to the file/directory that was specified.
Exceptions
The path contains Windows Reparse Points or otherwise cannot be accessed.