feat: updates, not works

This commit is contained in:
2024-09-01 18:28:53 +08:00
parent 5e87df07cd
commit 77b3e8aa02

View File

@@ -21,7 +21,7 @@ import (
const EncFileExt = ".__encfile"
var (
ErrFileForbiddenFileExt = errors.New("File ext is forbidden")
ErrFileForbiddenFileExt = errors.New("file ext is forbidden")
)
type EncFileMeta struct {
@@ -177,7 +177,17 @@ func (f *EncFile) Seek(offset int64, whence int) (int64, error) {
if checkIsFileErr != nil {
return 0, checkIsFileErr
}
return f.file.Seek(offset, whence)
// I do not understand whence
if whence != 0 {
return 0, fmt.Errorf("not supported whence: %d", whence)
}
ret, err := f.file.Seek(offset, whence)
if err != nil {
f.filePos = offset
}
return ret, err
}
func (f *EncFile) Write(p []byte) (n int, err error) {