forked from smallfish/ftp
-
Notifications
You must be signed in to change notification settings - Fork 0
FTP Client For Go Language
Nuntawut/ftp.go
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
FTP client for Google Go language
example:
import "fmt"
import "os"
import "io/ioutil"
import "./ftp"
func main() {
// new ftp
ftp := new(ftp.FTP)
// set debug, default false
ftp.Debug = true
// connect
ftp.Connect("10.0.0.0", 20)
// login
ftp.Login("smallfish", "****")
// login failure
if ftp.Code == 530 {
fmt.Println("error: login failure")
os.Exit(-1)
}
// pwd
ftp.Pwd()
fmt.Println("code:", ftp.Code, ", message:", ftp.Message)
// mkdir new dir
ftp.Mkd("/smallfish")
// stor new file
ftp.Request("TYPE I")
b, _ := ioutil.ReadFile("/path/a.txt")
ftp.Stor("/smallfish/a.txt", b)
// quit
ftp.Quit()
}
About
FTP Client For Go Language
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published