Sisk

Method

LogStream.SafeAppendToFile

Namespace
Sisk.Core.Http
Assembly
Sisk.Core.dll

SafeAppendToFile(string, string?) #

Safely appends the specified string to the specified file path.

C#
public static bool SafeAppendToFile(string filePath, string? text)

Parameters #

filePath string

The path to the file where the string will be appended.

text string?

The string to append to the file. Can be null.

Returns #

bool

true if the operation was successful, otherwise false.

Remarks #

Calls to these file helper methods for the same normalized full path are serialized within the current process. Synchronous and asynchronous overloads share the same per-file lock, while calls for different files can run concurrently. Access is not coordinated across processes.

SafeAppendToFile(string, string?, Encoding) #

Safely appends the specified string to the specified file path.

C#
public static bool SafeAppendToFile(string filePath, string? text, Encoding encoding)

Parameters #

filePath string

The path to the file where the string will be appended.

text string?

The string to append to the file. Can be null.

encoding Encoding

The encoding to use when appending the string.

Returns #

bool

true if the operation was successful, otherwise false.

Remarks #

Calls to these file helper methods for the same normalized full path are serialized within the current process. Synchronous and asynchronous overloads share the same per-file lock, while calls for different files can run concurrently. Access is not coordinated across processes.

SafeAppendToFile(string, string[]) #

Safely appends the specified lines to the specified file path.

C#
public static bool SafeAppendToFile(string filePath, string[] lines)

Parameters #

filePath string

The path to the file where the lines will be appended.

lines string[]

The lines to append to the file.

Returns #

bool

true if the operation was successful, otherwise false.

Remarks #

Calls to these file helper methods for the same normalized full path are serialized within the current process. Synchronous and asynchronous overloads share the same per-file lock, while calls for different files can run concurrently. Access is not coordinated across processes.

SafeAppendToFile(string, string[], Encoding) #

Safely appends the specified lines to the specified file path.

C#
public static bool SafeAppendToFile(string filePath, string[] lines, Encoding encoding)

Parameters #

filePath string

The path to the file where the lines will be appended.

lines string[]

The lines to append to the file.

encoding Encoding

The encoding to use when appending the lines.

Returns #

bool

true if the operation was successful, otherwise false.

Remarks #

Calls to these file helper methods for the same normalized full path are serialized within the current process. Synchronous and asynchronous overloads share the same per-file lock, while calls for different files can run concurrently. Access is not coordinated across processes.

Type to search the documentation and the API reference.