mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
Add a sftp_tell64() function.
This commit is contained in:
@@ -469,6 +469,17 @@ int sftp_seek64(SFTP_FILE *file, u64 new_offset);
|
|||||||
*/
|
*/
|
||||||
unsigned long sftp_tell(SFTP_FILE *file);
|
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
|
* @brief Rewinds the position of the file pointer to the beginning of the
|
||||||
* file.
|
* file.
|
||||||
|
|||||||
@@ -1777,7 +1777,11 @@ int sftp_seek64(SFTP_FILE *file, u64 new_offset) {
|
|||||||
|
|
||||||
/* Report current byte position in file. */
|
/* Report current byte position in file. */
|
||||||
unsigned long sftp_tell(SFTP_FILE *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.*/
|
/* Rewinds the position of the file pointer to the beginning of the file.*/
|
||||||
|
|||||||
Reference in New Issue
Block a user