public static WriteTextFile ( string path, string content ) : void | ||
path | string | |
content | string | |
return | void |
public static void WriteTextFile(string path, string content)
{
int attempts = FileIORetryCount;
do
{
try
{
File.WriteAllText(path, content);
return;
}
catch (IOException)
{
attempts--;
if (attempts == 0) throw;
System.Threading.Thread.Sleep(FileIORetrySleep);
}
} while (true);
}
public void AddTextFileContent(string key, string filename, string content) { EnsureKey(key); FileUtils.WriteTextFile(MakePath(key, filename), content); if (Added != null) { Added(this, new FileCacheStoreAddedEventArgs() { SizeKB = content.Length * sizeof(char) }); } }