public void FSCreateDirectory(string name, Session sess) { Console.WriteLine(this.Parent.Name + "\\\\" + this.Name + " : Creating Directory : " + name); string[] items = name.Split('\\'); File currentDir = this.RootFile; for (int i = 0; i < items.Length; i++) { currentDir = currentDir.GetDirectory(items[i], true, sess.CurrentUser); } }
public File FSGetDirectory(string name, Session sess) { string[] items = name.Split('\\'); File currentDir = this.RootFile; for (int i = 0; i < items.Length - 1; i++) { File target = currentDir.GetDirectory(items[i], false, sess.CurrentUser); if (target != null) { currentDir = target; } else { throw new Exception("Directory not Found"); } } return(currentDir); }