mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
add a File interface so we can avoid to use os.File directly
This commit is contained in:
@@ -81,13 +81,13 @@ func (fs *OsFs) Lstat(name string) (os.FileInfo, error) {
|
||||
}
|
||||
|
||||
// Open opens the named file for reading
|
||||
func (*OsFs) Open(name string, offset int64) (*os.File, *pipeat.PipeReaderAt, func(), error) {
|
||||
func (*OsFs) Open(name string, offset int64) (File, *pipeat.PipeReaderAt, func(), error) {
|
||||
f, err := os.Open(name)
|
||||
return f, nil, nil, err
|
||||
}
|
||||
|
||||
// Create creates or opens the named file for writing
|
||||
func (*OsFs) Create(name string, flag int) (*os.File, *PipeWriter, func(), error) {
|
||||
func (*OsFs) Create(name string, flag int) (File, *PipeWriter, func(), error) {
|
||||
var err error
|
||||
var f *os.File
|
||||
if flag == 0 {
|
||||
|
||||
Reference in New Issue
Block a user