Skip to content

Commit

Permalink
Added the ability to send a raw ftp command to the server. This is us…
Browse files Browse the repository at this point in the history
…eful for sending SITE commands or to support non-standard behaviour.
  • Loading branch information
stancarney committed Oct 16, 2015
1 parent e050cac commit 7335f60
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,18 @@ func (c *Client) Close() error {
return nil
}

// RawCmd Sends a raw ftp command to the FTP server. Useful for things like SITE commands.
func (c *Client) RawCmd(cmd string) (int, string, error) {
pconn, err := c.getIdleConn()
if err != nil {
return 0, "", err
}

defer c.returnConn(pconn)

return pconn.sendCommand(cmd)
}

// Log a debug message in the context of the client (i.e. not for a
// particular connection).
func (c *Client) debug(f string, args ...interface{}) {
Expand Down

0 comments on commit 7335f60

Please sign in to comment.