sftp: Add sftp_fsync() function

BUG: https://red.libssh.org/issues/141

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2016-10-05 18:26:14 +02:00
parent dbf72ffba2
commit 155a155d1d
2 changed files with 128 additions and 1 deletions

View File

@@ -788,6 +788,22 @@ LIBSSH_API sftp_statvfs_t sftp_fstatvfs(sftp_file file);
*/
LIBSSH_API void sftp_statvfs_free(sftp_statvfs_t statvfs_o);
/**
* @brief Synchronize a file's in-core state with storage device
*
* This calls the "fsync@openssh.com" extention. You should check if the
* extensions is supported using:
*
* @code
* int supported = sftp_extension_supported(sftp, "fsync@openssh.com", "1");
* @endcode
*
* @param file The opened sftp file handle to sync
*
* @return 0 on success, < 0 on error with ssh and sftp error set.
*/
LIBSSH_API int sftp_fsync(sftp_file file);
/**
* @brief Canonicalize a sftp path.
*