/// <summary> /// Quick file saving /// </summary> /// <param name="location">Location of file. Must include file name.</param> /// <param name="contents">Contents of file</param> /// <param name="filesystem">Predefined filesystem</param> /// <param name="owner">Owner of file?</param> public void saveFile(string location, string contents, IO.FileSystem.VirtualFileSystem filesystem, string owner = "root") { byte[] dat = new byte[contents.Length]; for (int i = 0; i < contents.Length; i++) { dat[i] = (byte)contents[i]; } filesystem.saveFile(dat, location, owner); }
/// <summary> /// Quick file opening /// </summary> /// <param name="location">Location of file. Must include file name.</param> /// <param name="filesystem">Predefined filesystem</param> public string openFile(string location, IO.FileSystem.VirtualFileSystem filesystem) { byte[] file = null; file = filesystem.readFile(location); string accum = ""; for (int i = 0; i < file.Length; i++) { accum += ((char)file[i]).ToString(); } return(accum); }