public static void ioWriteAllLines(eKnownFiles which, string[] contents) { lockAndProcess(delegate() { File.WriteAllLines(getFilePath(which), contents); }); }
public static void ioAppend(eKnownFiles which, string text) { lockAndProcess(delegate() { using (StreamWriter sw = File.AppendText(getFilePath(which))) { sw.WriteLine(text); } }); }
public static string ioReadAllText(eKnownFiles which) { string r = null; lockAndProcess(delegate() { r = File.ReadAllText(getFilePath(which)); }); return(r); }
public static long ioSize(eKnownFiles which) { long size = -1; lockAndProcess(delegate() { try { size = new System.IO.FileInfo(getFilePath(which)).Length; } catch (Exception) { } }); return(size); }
public static bool IsKnown(string inName, out eKnownFiles which) { which = eKnownFiles._end; foreach (var x in info) { if (x.Name == inName) { which = x.Id; return(true); } } return(false); }
public static string Get(eKnownFiles which) { return(info[(int)which].Name); }
private static string getFilePath(eKnownFiles which) { return(info[(int)which].Path); }
public eachInfo(eKnownFiles Id, string Path, string Name) { this.Id = Id; this.Path = Path; this.Name = Name; }
public static void ioDelete(eKnownFiles which) { lockAndProcess(delegate() { File.Delete(getFilePath(which)); }); }