namespace AIStudio.Tools;
public static class FileInfoExtensions
{
/// The file info object.
extension(FileInfo fileInfo)
{
///
/// Returns the file size in human-readable format.
///
/// The file size in human-readable format.
public string FileSize()
{
if (!fileInfo.Exists)
return "N/A";
return fileInfo.Length.FileSize();
}
}
}