Add CopyFile, refactor DeleteFile.

This commit is contained in:
2024-03-12 12:23:56 -04:00
parent 2d2bff7a0e
commit b2a2bc95df
15 changed files with 32 additions and 280 deletions

View File

@@ -623,11 +623,20 @@ namespace MarketData.Utils
{
return double.IsNaN(value);
}
public static void DeleteFile(String pathFileName)
public static bool DeleteFile(String pathFileName)
{
if(!File.Exists(pathFileName))return;
try{File.Delete(pathFileName);}catch(Exception){;}
if(!File.Exists(pathFileName))return false;
try{File.Delete(pathFileName);}catch(Exception){return false;}
return true;
}
public static bool CopyFile(String pathSrcFileName,String pathDstFileName)
{
if(!File.Exists(pathSrcFileName))return false;
try{File.Copy(pathSrcFileName,pathDstFileName);}catch(Exception){return false;}
return true;
}
private static DateTime GetRunDate(String strPathFileName)
{
DateTime runDate=DateTime.Now.Date;