diff options
-rw-r--r-- | include/libssh/sftp.h | 11 | ||||
-rw-r--r-- | libssh/sftp.c | 6 |
2 files changed, 16 insertions, 1 deletions
diff --git a/include/libssh/sftp.h b/include/libssh/sftp.h index 83fb40c3..eace5372 100644 --- a/include/libssh/sftp.h +++ b/include/libssh/sftp.h @@ -470,6 +470,17 @@ int sftp_seek64(SFTP_FILE *file, u64 new_offset); unsigned long sftp_tell(SFTP_FILE *file); /** + * @brief Report current byte position in file. + * + * @param file Open sftp file handle. + * + * @return The offset of the current byte relative to the beginning + * of the file associated with the file descriptor. < 0 on + * error. + */ +u64 sftp_tell64(SFTP_FILE *file); + +/** * @brief Rewinds the position of the file pointer to the beginning of the * file. * diff --git a/libssh/sftp.c b/libssh/sftp.c index f720aa58..f94c5ff3 100644 --- a/libssh/sftp.c +++ b/libssh/sftp.c @@ -1777,7 +1777,11 @@ int sftp_seek64(SFTP_FILE *file, u64 new_offset) { /* Report current byte position in file. */ unsigned long sftp_tell(SFTP_FILE *file) { - return file->offset; + return (unsigned long)file->offset; +} +/* Report current byte position in file. */ +u64 sftp_tell64(SFTP_FILE *file) { + return (u64)file->offset; } /* Rewinds the position of the file pointer to the beginning of the file.*/ |