ftp
ftp copied to clipboard
Timeout on errors
If my user doesn't have write permissions, occurs this:
<cmd> <code> 220 <message> (vsFTPd 2.3.5) <cmd> USER xxxxxxxxxx <code> 331 <message> Please specify the password. <cmd> PASS yyyyyyyyyyyyyy <code> 230 <message> Login successful. <cmd> PASV <code> 227 <message> Entering Passive Mode (127,0,0,1,39,156). <cmd> STOR hola.go <code> 550 <message> Permission denied. <response> OK
And the program don't exits. How can I terminate the program if un error occurs, or after a timeout?
I tried to add this (after ftp.Stor("hola.go", b)):
if ftp.Code == 550 { fmt.Println("error: permissions failure") os.Exit(-1) }
but it does not work.. :(
Thanks for report this, i will test and fix it.