I want run ncftpput in go and want to get the output string for analysis but Only the following style can be output.
cmdStr := "ncftpput -R -f C:\\Users\\xx\\source\\go\\depolyment\\cfg\\login.cfg / C:\\Users\\xx\\source\\go\\depolyment\\cfg"
args := strings.Split(cmdStr, " ")
cmd := exec.Command(args[0], args[1:]...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Run()
I have tried many methods and the output is allways empty,such as:
cmd.Output()
cmd.CombinOutput()
io.Pipe()
Who can help me solve this problem, tks!
My solution is add log file to ncftpput