Table of Contents

Class FileUtil

Namespace
Oscova.Agents.Utils
Assembly
Oscova.Agents.dll

File operations shared by reusable toolsets and host infrastructure.

public static class FileUtil

Inheritance

Inherited Members

Methods

AppendLineSharedAsync(string, string, CancellationToken)

Appends a single line through a shared handle so concurrent readers do not fail on file locks.

CreateSiblingTempPath(string)

Creates a unique temporary path beside path without touching the filesystem.

ReadAllLinesShared(string)

Reads all lines through a shared handle so appenders or atomic replacements do not cause file-in-use errors. A line still being flushed by a concurrent appender may read truncated, so callers must tolerate a malformed last line.

WriteAllTextAtomic(string, string)

Writes text to path atomically by staging beside the target before replacing it.

WriteAllTextAtomicAsync(string, string, CancellationToken)

Writes text to path atomically by staging beside the target before replacing it.

WriteStreamAtomicAsync(string, Stream, CancellationToken)

Writes a stream to path atomically by staging beside the target before replacing it.