Fix append (#43)
* fix(fs/local): remove O_APPEND for write_at * fix(files): clean download api * chore(workflows): add manual dispatch for docker * test(files): close fd in the progress of uploading
This commit is contained in:
parent
9b2157ac6a
commit
a9ccb4506c
4 changed files with 61 additions and 11 deletions
|
@ -185,7 +185,7 @@ func (fs *LocalFS) ReadAt(path string, b []byte, off int64) (int, error) {
|
|||
}
|
||||
|
||||
// because the fd may be for other usage, its flag is not set as os.O_RDONLY
|
||||
fd, err := os.OpenFile(fullpath, os.O_RDWR|os.O_APPEND, fs.defaultPerm)
|
||||
fd, err := os.OpenFile(fullpath, os.O_RDWR, fs.defaultPerm)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ func (fs *LocalFS) WriteAt(path string, b []byte, off int64) (int, error) {
|
|||
}
|
||||
|
||||
// it does NOT create file for writing
|
||||
fd, err := os.OpenFile(fullpath, os.O_RDWR|os.O_APPEND, fs.defaultPerm)
|
||||
fd, err := os.OpenFile(fullpath, os.O_RDWR, fs.defaultPerm)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue