Share via


ReparsePointAware.CreateText(String) Method

Definition

Creates or opens a file for writing UTF-8 encoded text. If opening an existing file, the file is truncated. If the file's canonical path contains Windows Reparse Points, UnauthorizedAccessException is thrown and nothing is written.

public static System.IO.StreamWriter CreateText (string path);
static member CreateText : string -> System.IO.StreamWriter
Public Shared Function CreateText (path As String) As StreamWriter

Parameters

path
String

Full path to the target file.

Returns

A StreamWriter to the file being opened. Caller is responsible for disposing of the StreamWriter when operations are complete.

Exceptions

The path contains Windows Reparse Points or otherwise cannot be accessed.

Applies to