Skip to content

Conversation

@benedikt-schesch
Copy link

Summary

Implements the FTP APPE (append) command as defined in RFC 959. This command appends data to an existing file, or creates a new file if it doesn't exist.

Changes

  • Add Appe variant to Command enum and parser
  • Add Appe variant to DataChanCmd for data channel communication
  • Implement Appe command handler in commands/appe.rs
  • Implement exec_appe() in datachan.rs - gets current file size via metadata() and calls put() with that offset
  • Add integration tests for:
    • Appending to an existing file
    • Appending to a non-existent file (creates it)

RFC 959 Reference

This command causes the server-DTP to accept the data transferred via the data connection and to store the data in a file at the server site. If the file specified in the pathname exists at the server site, the data shall be appended to that file; otherwise the file shall be created.

Testing

cargo test appe

@benedikt-schesch
Copy link
Author

#52

@benedikt-schesch
Copy link
Author

benedikt-schesch commented Jan 19, 2026

Full disclosure: kiro-cli and Claude Opus 4.5 have been used in this PR but I verified the diff to make sure it makes sense

Add support for the FTP APPE command which appends data to an existing
file or creates a new file if it doesn't exist.

Changes:
- Add Appe variant to Command enum and parser
- Add Appe variant to DataChanCmd for data channel communication
- Implement Appe command handler
- Implement exec_appe in datachan (gets file size, appends at end)
- Add integration tests for append to existing and new files
@benedikt-schesch
Copy link
Author

@hannesdejager Hi Hannes, any chance you could spare this a review? :) Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants