public MemFSFile(string path, MemFSDir parent) { if (parent != null && !parent.GetRoot()) { _path = parent.GetPath() + "/" + path; } else if (parent != null && parent.GetRoot()) { if (parent.GetPath().EndsWith("/")) { _path = parent.GetPath() + path; } else { _path = parent.GetPath() + "/" + path; } } else { _path = path; } _parent = parent; _reading = new ConcurrentDictionary <ObservableMemoryStream, ObservableMemoryStream>(); _writing = new ConcurrentDictionary <ObservableMemoryStream, ObservableMemoryStream>(); _data = new MemoryStream(); }
public MemFSDir(string path, MemFSDir parent) { if (parent != null && !parent.GetRoot()) { _path = parent.GetPath() + "/" + path; } else if (parent != null && parent.GetRoot()) { if (parent.GetPath().EndsWith("/")) { _path = parent.GetPath() + path; } else { _path = parent.GetPath() + "/" + path; } } else { _path = path; } _parent = parent; _directories = new List <Dir422>(); _files = new List <File422>(); }
public override Dir422 CreateDir(string dirName) { if (!CheckValidName(dirName)) { return(null); } Dir422 newDir = GetDir(dirName); if (newDir == null) { newDir = new MemFSDir(dirName, this); _directories.Add(newDir); } return(newDir); }
public MemoryFileSystem() { Root = new MemFSDir("/", null); Root.SetRoot(true); }