1
1

- Based on bug #1815692, we introduce libssh2_sftp_seek2() that allows seeking

beyond the 2GB margin even on 32bit machines.
Этот коммит содержится в:
Daniel Stenberg 2008-09-29 14:11:29 +00:00
родитель 93ae080bbc
Коммит 61fda23340
4 изменённых файлов: 24 добавлений и 4 удалений

3
NEWS
Просмотреть файл

@ -1,6 +1,9 @@
Version 0.19 ( )
-------------------------------
- Based on bug #1815692, we introduce libssh2_sftp_seek2() that allows seeking
beyond the 2GB margin even on 32bit machines.
- Based on a patch in bug #1878059 by Steven Ayre libssh2 now parses >2GB file
sizes when downloading SCP files.

Просмотреть файл

@ -1,4 +1,4 @@
.\" $Id: libssh2_sftp_seek.3,v 1.1 2007/06/14 16:08:43 jehousley Exp $
.\" $Id: libssh2_sftp_seek.3,v 1.2 2008/09/29 14:11:30 bagder Exp $
.\"
.TH libssh2_sftp_seek 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
.SH NAME
@ -10,6 +10,9 @@ libssh2_sftp_seek - set the read/write position indicator within a file
void
libssh2_sftp_seek(LIBSSH2_SFTP_HANDLE *handle, size_t offset);
void
libssh2_sftp_seek2(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset);
.SH DESCRIPTION
\fIhandle\fP - SFTP File Handle as returned by
.BR libssh2_sftp_open(3)
@ -22,5 +25,7 @@ file access appear more POSIX like. No packets are exchanged with the server
during a seek operation. The localized file pointer is simply used as a
convenience offset during read/write operations.
Note that the \fBlibssh2_sftp_seek2(3)\fP function was added in 0.19 to make it
possible to seek in large files even on 32bit systems.
.SH SEE ALSO
.BR libssh2_sftp_open(3)

Просмотреть файл

@ -1,4 +1,4 @@
/* Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org>
/* Copyright (c) 2004-2008, Sara Golemon <sarag@libssh2.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms,
@ -206,7 +206,8 @@ LIBSSH2_API int libssh2_sftp_close_handle(LIBSSH2_SFTP_HANDLE *handle);
#define libssh2_sftp_closedir(handle) libssh2_sftp_close_handle(handle)
LIBSSH2_API void libssh2_sftp_seek(LIBSSH2_SFTP_HANDLE *handle, size_t offset);
#define libssh2_sftp_rewind(handle) libssh2_sftp_seek((handle), 0)
LIBSSH2_API void libssh2_sftp_seek2(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset);
#define libssh2_sftp_rewind(handle) libssh2_sftp_seek2((handle), 0)
LIBSSH2_API size_t libssh2_sftp_tell(LIBSSH2_SFTP_HANDLE *handle);

Просмотреть файл

@ -1,4 +1,4 @@
/* Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org>
/* Copyright (c) 2004-2008, Sara Golemon <sarag@libssh2.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms,
@ -1528,6 +1528,17 @@ libssh2_sftp_seek(LIBSSH2_SFTP_HANDLE * handle, size_t offset)
/* }}} */
/* {{{ libssh2_sftp_seek2
* Set the read/write pointer to an arbitrary position within the file
*/
LIBSSH2_API void
libssh2_sftp_seek2(LIBSSH2_SFTP_HANDLE * handle, libssh2_uint64_t offset)
{
handle->u.file.offset = offset;
}
/* }}} */
/* {{{ libssh2_sftp_tell
* Return the current read/write pointer's offset
*/