public static string WriteUniqueTimedFile( string pathPrefix, string fileSuffix, DateTime time, byte[] content, bool withUTF8Bom, int maxTryBeforeGuid = 3 )
{
string fullLogFilePath;
using( var f = CreateAndOpenUniqueTimedFile( pathPrefix, fileSuffix, time, FileAccess.Write, FileShare.Read, 8, FileOptions.SequentialScan | FileOptions.WriteThrough, maxTryBeforeGuid ) )
{
Debug.Assert( Encoding.UTF8.GetPreamble().Length == 3 );
if( withUTF8Bom ) f.Write( Encoding.UTF8.GetPreamble(), 0, 3 );
if( content != null && content.Length > 0 ) f.Write( content, 0, content.Length );
fullLogFilePath = f.Name;
}
return fullLogFilePath;
}