|
|
|
@ -5,7 +5,6 @@ import ( |
|
|
|
"fmt" |
|
|
|
"net/rpc" |
|
|
|
"os" |
|
|
|
"path/filepath" |
|
|
|
|
|
|
|
"scalib/util" |
|
|
|
"strings" |
|
|
|
@ -78,19 +77,19 @@ func transferFile(c *UpFileClient, curPath string, uploadPath string) error { |
|
|
|
fileInfo, err := os.Stat(curPath) |
|
|
|
if err != nil { |
|
|
|
// panic(err)
|
|
|
|
fmt.Printf("获取文件信息失败: %v\n", err) |
|
|
|
// fmt.Printf("获取文件信息失败: %v\n", err)
|
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
// 提取文件名
|
|
|
|
// 远程的文件名
|
|
|
|
fileName := filepath.Base(uploadPath) |
|
|
|
fmt.Printf("fileName: %s\n", fileName) |
|
|
|
// fileName := filepath.Base(uploadPath)
|
|
|
|
// fmt.Printf("fileName: %s\n", fileName)
|
|
|
|
|
|
|
|
// 远程服务器的路径
|
|
|
|
dirpath := filepath.Dir(uploadPath) |
|
|
|
fmt.Printf("remote dirpath: %s\n", dirpath) |
|
|
|
fmt.Printf("file size: %d\n", fileInfo.Size()) |
|
|
|
// dirpath := filepath.Dir(uploadPath)
|
|
|
|
// fmt.Printf("remote dirpath: %s\n", dirpath)
|
|
|
|
// fmt.Printf("file size: %d\n", fileInfo.Size())
|
|
|
|
|
|
|
|
// 异步
|
|
|
|
go func() { |
|
|
|
|