SafeFileName Property

Definition

Namespace Broadside
Assembly Broadside.dll

Gets the last component of FileName, made safe to use as a file name on any platform, or null when nothing usable is left. Backslashes and drive prefixes count as separators; characters no platform allows (NUL, control characters, / \ : * ? " < > |) become ; trailing dots and spaces are removed; a reserved device name (CON, NUL, COM1, ...) is prefixed with ; . and .. give null.

public string? SafeFileName { get; }

Returns

Remarks

Not a spec concept: file names are untrusted input (CWE-22). The library itself never writes a file under any name.