Browse Source

合并路径,转为unix风格

master
xyiege 5 months ago
parent
commit
ca2375b02e
  1. 9
      aufs/core/AuFile.go

9
aufs/core/AuFile.go

@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"net/rpc/jsonrpc" "net/rpc/jsonrpc"
"path/filepath"
"strings" "strings"
) )
@ -49,10 +50,14 @@ func Flist(w http.ResponseWriter, r *http.Request) {
} }
// 基础目录名称 // 基础目录名称
basepath := "/www/wwwroot" basepath := "/www/wwwroot"
basepath = fmt.Sprintf("%v%v", basepath, wdir) // 拼装路径,并转位unix路径
newpath := filepath.ToSlash(filepath.Join(basepath, wdir))
fmt.Printf("newpath:%v\n", newpath)
// basepath = fmt.Sprintf("%v%v", basepath, wdir)
// 调用远程方法 // 调用远程方法
var reply string var reply string
var args = Args{basepath, "dir"} var args = Args{newpath, "dir"}
// var args = Args{"/www/wwwroot/fsc.com", "dir"} // var args = Args{"/www/wwwroot/fsc.com", "dir"}
err = client.Call("FileRpcService.GetFilePath", args, &reply) err = client.Call("FileRpcService.GetFilePath", args, &reply)
// 执行完成后退出 // 执行完成后退出

Loading…
Cancel
Save