VFSSafeExtensions.TryCreateFile(thisIVirtualFileSystem,string,string).md

January 20, 2026 ยท View on GitHub

Atypical.VirtualFileSystem.Core

Atypical.VirtualFileSystem.Core.Extensions.VFSSafeExtensions

VFSSafeExtensions.TryCreateFile(this IVirtualFileSystem, string, string) Method

Safely creates a file without throwing exceptions.

public static bool TryCreateFile(this Atypical.VirtualFileSystem.Core.Contracts.IVirtualFileSystem vfs, string filePath, string? content=null);

Parameters

vfs IVirtualFileSystem

The virtual file system.

filePath System.String

The file path as a string.

content System.String

The file content.

Returns

System.Boolean
True if the file was created successfully, false otherwise.