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:
Hexxa 2021-03-19 23:00:22 +08:00 committed by GitHub
parent 9b2157ac6a
commit a9ccb4506c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 11 deletions

View file

@ -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
}