FileSystemAgentFileStore Class

Definition

A file-system-backed implementation of AgentFileStore that stores files on disk under a configurable root directory.

public sealed class FileSystemAgentFileStore : Microsoft.Agents.AI.AgentFileStore
type FileSystemAgentFileStore = class
    inherit AgentFileStore
Public NotInheritable Class FileSystemAgentFileStore
Inherits AgentFileStore
Inheritance
FileSystemAgentFileStore

Remarks

All paths passed to this store are resolved relative to the root directory provided at construction time. Lexical path traversal attempts (for example, via .. segments or absolute paths) are rejected with an ArgumentException.

The root directory is created automatically if it does not already exist.

Constructors

Name Description
FileSystemAgentFileStore(String)

Initializes a new instance of the FileSystemAgentFileStore class.

Methods

Name Description
CreateDirectoryAsync(String, CancellationToken)

Ensures a directory exists, creating it if necessary.

DeleteAsync(String, CancellationToken)

Deletes a file.

FileExistsAsync(String, CancellationToken)

Checks whether a file exists.

ListChildrenAsync(String, CancellationToken)

Lists the direct children (files and subdirectories) of a directory.

ReadAsync(String, CancellationToken)

Reads the content of a file.

SearchAsync(String, String, String, Boolean, CancellationToken)

Searches for files whose content matches a regular expression pattern.

WriteAsync(String, String, CancellationToken)

Writes content to a file, creating or overwriting it.

Applies to