IETF-SSH archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

New SFTP extension: copy files on server...



I know I promised we were done adding complexity,
but as an non-mandatory extension, I think this
could provide a significant performance optimization
for some users:

       byte   SSH_FXP_EXTENDED
       uint32 request-id
       string "copy"
       string src-path [UTF-8]
       string dst-path [UTF-8]
       UINT   cpy-flags

cpy-flags would be:

  SFX_CPY_RECURSIVE
    Without this flag, src-path most not be a directory

  SFX_CPY_OVERWRITE
    This flag requests that if 'dst-path' exists, it be
    overwritten.

    Because of the semantics of the copy operation (and
    limitations on the server) it is not possible to
    overwrite a directory.

  SFX_CPY_PRESERVE
    This flag requests the server to preserve mode,
    owner, group, and access control lists.

    What is actually preserved is implementation dependent.

If 'dst-path' does not exist, the server uses the exact
path specified in 'dst-path' for the destination.

If 'dst-path' exists, and is a directory, the server uses
the builds the actual 'dst-path' by combining the specified
path with the last component of the src-path.

If the 'dst-path' derived in this fashion already exists,
and is a folder, and the src-path is not a folder, it
is an error.

If the src-path is a folder, and SFX_CPY_OVERWRITE is specified,
the files from the src-path are copied into the target folder,
overwriting an files that have the same name.  Files already
existing in the dst-path that are not in the src-path are not
changed in any way.

Thoughts?  Hate it?  Love it, but it needs X?

Thanks,

Joseph



Home | Main Index | Thread Index | Old Index