public NewFileBlockWriter OpenNew(FSItem item) { var path = Path.Combine(cachePath, item.Id); var result = new NewFileBlockWriter(item, path); result.OnClose = async() => { if (!result.Cancelled) { await AddUpload(item); } }; return(result); }
public NewFileBlockWriter OpenTruncate(FSItem item) { var path = Path.Combine(cachePath, item.Id); var result = new NewFileBlockWriter(item, path); result.SetLength(0); result.OnClose = async() => { if (!result.Cancelled) { await AddOverwrite(item); } }; return(result); }