Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/sys/fs_mem.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package sys

import (
"errors"
"fmt"
"io/fs"
"os"
"path/filepath"
Expand Down Expand Up @@ -42,9 +43,10 @@ func (mfs *MemFS) Open(name string) (File, error) {
defer mfs.Unlock()
file := mfs.files[name]
if file != nil {
fmt.Println("file exists", name)
return file, nil
}

fmt.Println("does not exist", name)
fileName := filepath.Base(name)

file = &MemFile{Name: fileName, Mode: fs.ModePerm, ModTime: time.Now()}
Expand Down
3 changes: 2 additions & 1 deletion wasmsdk/blobber.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ func multiDownload(allocationID, jsonMultiDownloadOptions, authTicket, callbackF
wg.Add(len(options))
for ind, option := range options {
fileName := strings.Replace(path.Base(option.RemotePath), "/", "-", -1)
localPath := allocationID + "_" + fileName
localPath := encryption.FastHash(allocationID + "_" + fileName + zboxutil.NewConnectionId())
option.LocalPath = localPath
statusBar := &StatusBar{wg: wg, totalBytesMap: make(map[string]int)}
allStatusBar[ind] = statusBar
Expand All @@ -487,6 +487,7 @@ func multiDownload(allocationID, jsonMultiDownloadOptions, authTicket, callbackF
return "", err
}
} else {
fmt.Println("Downloading to memory: ", localPath, option.RemotePath)
statusBar.localPath = localPath
fs, _ := sys.Files.Open(localPath)
mf, _ = fs.(*sys.MemFile)
Expand Down
Loading