Keine Beschreibung

Julien Laffaye 072f1b4f5a Merge pull request #163 from xperimental/go-module vor 6 Jahren
.github 9b5a3addd7 Update issue templates vor 7 Jahren
.travis.yml 1fb6f135ee Run travis with current version. vor 6 Jahren
LICENSE 3a7f65cd20 Update copyright years. vor 13 Jahren
README.md 9bf9e0098a Improve readme (#154) vor 7 Jahren
client_test.go 04b1878733 Add DialWithOptions vor 7 Jahren
conn_test.go e6de3d35bf Replace DialWithOptions with Dial vor 7 Jahren
debug.go 8b7b512afb Add DialWithDebugOutput to log commands. vor 7 Jahren
ftp.go 7cd8b0bcf3 Fix spelling errors vor 7 Jahren
go.mod c037483193 Create Go module. vor 6 Jahren
go.sum c037483193 Create Go module. vor 6 Jahren
parse.go c1312a7102 Correctly parse symlink (#152) vor 7 Jahren
parse_test.go c1312a7102 Correctly parse symlink (#152) vor 7 Jahren
scanner.go 602886c6b8 Do not export the scanner type vor 9 Jahren
scanner_test.go 602886c6b8 Do not export the scanner type vor 9 Jahren
status.go 72f5c01749 StatusText returns a text for the FTP status code vor 7 Jahren
status_test.go 8019e67744 Add tests for StatusText vor 7 Jahren

README.md

goftp

Build Status Coverage Status Go ReportCard godoc.org

A FTP client package for Go

Install

go get -u github.com/jlaffaye/ftp

Example

c, err := ftp.Dial("ftp.example.org:21", ftp.DialWithTimeout(5*time.Second))
if err != nil {
    log.Fatal(err)
}

err = c.Login("anonymous", "anonymous")
if err != nil {
    log.Fatal(err)
}

// Do something with the FTP conn

if err := c.Quit(); err != nil {
    log.Fatal(err)
}

Store a file example

data := bytes.NewBufferString("Hello World")
err = c.Stor("test-file.txt", data)
if err != nil {
	panic(err)
}

Read a file example

r, err := c.Retr("test-file.txt")
if err != nil {
	panic(err)
}

buf, err := ioutil.ReadAll(r)
println(string(buf))