Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFTP Rename with flags (atomic) #563

Closed
ahweis opened this issue Feb 24, 2020 · 1 comment
Closed

SFTP Rename with flags (atomic) #563

ahweis opened this issue Feb 24, 2020 · 1 comment

Comments

@ahweis
Copy link

ahweis commented Feb 24, 2020

The default SSH rename command do not sent any flags for how to handle the rename. In the SSH spec it is possible to send the three flags:

SSH_FXF_RENAME_OVERWRITE 0x00000001
SSH_FXF_RENAME_ATOMIC 0x00000002
SSH_FXF_RENAME_NATIVE 0x00000004

At the last uint32 part of the rename command. Will it be possible to extend the rename function to support a list of flags to include (default to 0) or create an overloaded function that supports this.

@ahweis ahweis closed this as completed Feb 24, 2020
lucamilanesio added a commit to lucamilanesio/sshj that referenced this issue Dec 7, 2020
The SFTP protocol allows to rename files by specifying
extra flags:

- OVERWRITE
- ATOMIC
- NATIVE

The flags are exposed through a new RenameFlags enum and
can be passed as parameters to the rename() method in
SFTPClient/SFTPEngine.

Relates to hierynomus#563
@lucamilanesio
Copy link
Contributor

@ahweis what happened to this issue? I provided a possible solution with the associated PR, can you have a look if that makes sense?

hierynomus added a commit that referenced this issue Sep 27, 2021
* Enable renaming with flags

The SFTP protocol allows to rename files by specifying
extra flags:

- OVERWRITE
- ATOMIC
- NATIVE

The flags are exposed through a new RenameFlags enum and
can be passed as parameters to the rename() method in
SFTPClient/SFTPEngine.

Relates to #563

* Update RenameFlags.java

* Update RenameFlags.java

* Align license header with all other files

* Make RenameFlags parameter in line with OpenMode(s)

Co-authored-by: Jeroen van Erp <jeroen@hierynomus.com>
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

No branches or pull requests

2 participants