CreateDirIfNotExists() public static method

public static CreateDirIfNotExists ( string filePath ) : void
filePath string
return void
Example #1
0
        public static void Write(string data, string fileName)
        {
            lock (logSync)
            {
                FileUtils.CreateDirIfNotExists(fileName);

                bool fileInUse = true;
                while (fileInUse)
                {
                    try
                    {
                        using (StreamWriter log = File.AppendText(fileName))
                        {
                            log.WriteLine(data);
                        }
                        fileInUse = false;
                    }
                    catch (System.IO.IOException)
                    {
                        fileInUse = true;
                    }
                }
            }
        }
Example #2
0
 Settings()
 {
     FileUtils.CreateDirIfNotExists(DataPath);
 }