improve temp dirs handling an some logs

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-10-17 18:06:52 +02:00
parent 254824b781
commit 6282f95bd3
11 changed files with 52 additions and 65 deletions

View File

@@ -64,12 +64,6 @@ type OsFs struct {
// NewOsFs returns an OsFs object that allows to interact with local Os filesystem
func NewOsFs(connectionID, rootDir, mountPath string, config *sdk.OSFsConfig) Fs {
var tempDir string
if tempPath != "" {
tempDir = tempPath
} else {
tempDir = filepath.Clean(os.TempDir())
}
var readBufferSize, writeBufferSize int
if config != nil {
readBufferSize = config.ReadBufferSize * 1024 * 1024
@@ -80,7 +74,7 @@ func NewOsFs(connectionID, rootDir, mountPath string, config *sdk.OSFsConfig) Fs
connectionID: connectionID,
rootDir: rootDir,
mountPath: getMountPath(mountPath),
localTempDir: tempDir,
localTempDir: getLocalTempDir(),
readBufferSize: readBufferSize,
writeBufferSize: writeBufferSize,
}