2021-09-05 10:02:31 -04:00
|
|
|
package envimpl
|
|
|
|
|
|
|
|
import (
|
2022-01-02 10:16:23 -05:00
|
|
|
"github.com/v2fly/v2ray-core/v5/common/environment"
|
|
|
|
"github.com/v2fly/v2ray-core/v5/common/platform/filesystem"
|
|
|
|
"github.com/v2fly/v2ray-core/v5/common/platform/filesystem/fsifce"
|
2021-09-05 10:02:31 -04:00
|
|
|
)
|
|
|
|
|
2021-11-27 01:32:07 -05:00
|
|
|
type fileSystemDefaultImpl struct{}
|
2021-09-05 10:02:31 -04:00
|
|
|
|
|
|
|
func (f fileSystemDefaultImpl) OpenFileForReadSeek() fsifce.FileSeekerFunc {
|
|
|
|
return filesystem.NewFileSeeker
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f fileSystemDefaultImpl) OpenFileForRead() fsifce.FileReaderFunc {
|
|
|
|
return filesystem.NewFileReader
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f fileSystemDefaultImpl) OpenFileForWrite() fsifce.FileWriterFunc {
|
|
|
|
return filesystem.NewFileWriter
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewDefaultFileSystemDefaultImpl() environment.FileSystemCapabilitySet {
|
|
|
|
return fileSystemDefaultImpl{}
|
|
|
|
}
|