Skip to content

Commit

Permalink
feat(fs): create symbolic link instead of copy local files (close #2186
Browse files Browse the repository at this point in the history
… in #3354)
  • Loading branch information
NewbieOrange authored Feb 12, 2023
1 parent 43a8ed4 commit 62dae50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/fs/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ func getFileStreamFromLink(file model.Obj, link *model.Link) (*model.FileStream,
if link.Data != nil {
rc = link.Data
} else if link.FilePath != nil {
// copy a new temp, because will be deleted after upload
// create a new temp symbolic link, because it will be deleted after upload
newFilePath := stdpath.Join(conf.Conf.TempDir, fmt.Sprintf("%s-%s", uuid.NewString(), file.GetName()))
err := utils.CopyFile(*link.FilePath, newFilePath)
err := os.Symlink(*link.FilePath, newFilePath)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 62dae50

Please sign in to comment.