public MetaFile CreateMetaFile(String source, String sourceName, String platform, String device, String driverVersion, String defines, String buildOptions) { MetaFile mf = null; while (true) { var randomFileName = Path.GetRandomFileName(); try { var fs = File.Open(this.Root + Path.DirectorySeparatorChar + randomFileName, FileMode.CreateNew, FileAccess.ReadWrite); fs.Close(); mf = new MetaFile(source, sourceName, platform, device, driverVersion, defines, buildOptions, randomFileName); this.MetaFiles.Add(mf); break; } catch (Exception) { Thread.CurrentThread.Join(50 + this.Random.Next(50)); } } return(mf); }
public MetaFile CreateMetaFile(string source, string sourceName, string platform, string device, string driverVersion, string defines, string buildOptions) { MetaFile mf = null; while (true) { string randomFileName = Path.GetRandomFileName(); try { FileStream fs = File.Open(Root + Path.DirectorySeparatorChar + randomFileName, FileMode.CreateNew, FileAccess.ReadWrite); fs.Close(); mf = new MetaFile(source, sourceName, platform, device, driverVersion, defines, buildOptions, randomFileName); MetaFiles.Add(mf); break; } catch (Exception) { Thread.CurrentThread.Join(50 + Random.Next(50)); } } return mf; }