public File Open(string path) { unsafe { Native.Status * status; Native.FileSystem *file_system = handle_.GetHandle(); Native.FileHandle *file = Native.Open(file_system, path, &status); if (file == null) { using (handles.StatusHandle handle = new handles.StatusHandle(status)) { throw new MatryoshkaException(handle); } } else { return(new File(this, file, path)); } } }
public File Push(string inner_path, string path, int chunk_size = -1) { unsafe { Native.Status * status; Native.FileSystem *file_system = handle_.GetHandle(); Native.FileHandle *file = Native.Push(file_system, inner_path, path, chunk_size, &status); if (file == null) { using (handles.StatusHandle handle = new handles.StatusHandle(status)) { throw new MatryoshkaException(handle); } } else { return(new File(this, file, path)); } } }
internal unsafe File(FileSystem parent, Native.FileHandle *handle, string path) { parent_ = parent; handle_ = new handles.FileHandle(handle); path_ = path; }
public unsafe FileHandle(Native.FileHandle *status) : base(true) { this.SetHandle(new IntPtr((void *)status)); }