# ftp **Repository Path**: itwennet/ftp ## Basic Information - **Project Name**: ftp - **Description**: FTP Client For Go(lang) - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-09-22 - **Last Updated**: 2024-09-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README FTP client for Go(lang) ================================== install ======== go get github.com/smallfish/ftp example ======== ```go package main import ( "fmt" "github.com/smallfish/ftp" "io/ioutil" "os" ) func main() { ftp := new(ftp.FTP) // debug default false ftp.Debug = true ftp.Connect("localhost", 21) // login ftp.Login("anonymous", "") if ftp.Code == 530 { fmt.Println("error: login failure") os.Exit(-1) } // pwd ftp.Pwd() fmt.Println("code:", ftp.Code, ", message:", ftp.Message) // make dir ftp.Mkd("/path") ftp.Request("TYPE I") // stor file b, _ := ioutil.ReadFile("/path/a.txt") ftp.Stor("/path/a.txt", b) ftp.Quit() } ```