private FileHandle Open(File file) { DokanFile df; if (!_openFiles.TryGetValue(file.ID, out df)) { df = new DokanFile(_fileSystem, file); _openFiles.Add(file.ID, df); } return(df.Open()); }
public static FileHandle CreateNewFileHandle(DokanFile file) { lock (_handles) { for (int i = 0; i < _handles.Count; i++) { if (_handles[i] == null) { FileHandle reusedHandle = new FileHandle(i, file); _handles[i] = reusedHandle; return(reusedHandle); } } FileHandle newHandle = new FileHandle(_handles.Count, file); _handles.Add(newHandle); return(newHandle); } }
public FileHandle(int id, DokanFile file) { ID = id; File = file; }