C# Class Sanguosha.Core.Utils.FileRotator

Maintains a file sequence fileName{Date}{Sequence number} and removes the most out dated file when number of files exceeds a certain threshold.
Not thread-safe.
Show file Open project: RagingBigFemaleBird/sgs

Public Methods

Method Description
CreateFile ( string pathName, string fileName, string extension, int maxAllowance ) : FileStream

GetLatestFileName ( string pathName, string fileName, string extension ) : string

Method Details

CreateFile() public static method

public static CreateFile ( string pathName, string fileName, string extension, int maxAllowance ) : FileStream
pathName string Path to the directory under which the new file is to be created.
fileName string Common prefix of the file name.
extension string Extension name of the file. Must starts with "."
maxAllowance int Maximum number of files allowed before rotation starts. Must be greater or equal to 0.
return System.IO.FileStream

GetLatestFileName() public static method

public static GetLatestFileName ( string pathName, string fileName, string extension ) : string
pathName string
fileName string
extension string
return string