OpenFileWriter 打开文件写入器
(hash string, bodySize int64, isPartial bool)
| 88 | |
| 89 | // OpenFileWriter 打开文件写入器 |
| 90 | func (this *FS) OpenFileWriter(hash string, bodySize int64, isPartial bool) (*FileWriter, error) { |
| 91 | if this.isClosed { |
| 92 | return nil, errors.New("the fs closed") |
| 93 | } |
| 94 | |
| 95 | if isPartial && bodySize <= 0 { |
| 96 | return nil, errors.New("invalid body size for partial content") |
| 97 | } |
| 98 | |
| 99 | bFile, err := this.openBFileForHashWriting(hash) |
| 100 | if err != nil { |
| 101 | return nil, err |
| 102 | } |
| 103 | return bFile.OpenFileWriter(hash, bodySize, isPartial) |
| 104 | } |
| 105 | |
| 106 | // OpenFileReader 打开文件读取器 |
| 107 | func (this *FS) OpenFileReader(hash string, isPartial bool) (*FileReader, error) { |