libssh2_sftp_seek64(3)
π libssh2_sftp_seek64 π
okay so bestie, this is a page from the libssh2 manual, and today's main character is libssh2_sftp_seek64 β the little function that sets the read/write position inside a file. no cap, that's the whole job. let's get into it π«Ά
β¨ NAME β¨
libssh2_sftp_seek64 β set the read/write position within a file
πΈ SYNOPSIS πΈ
#include <libssh2.h>
#include <libssh2_sftp.h>
void
libssh2_sftp_seek64(LIBSSH2_SFTP_HANDLE *handle,
libssh2_uint64_t offset);
π¦ DESCRIPTION π¦
so here's the tea on the arguments, bestie:
handleβ an SFTP File Handle, the kind you get back fromlibssh2_sftp_open_ex(3). that's your lil ticket to the file πoffsetβ how many bytes from the beginning of the file you wanna seek to. count them from the top, starting at zero-ish energy β¨
what it does: it moves the file handle's internal pointer to any arbitrary location you want. it's giving "teleport but for file positions" π
and here's the cute design detail β libssh2 implements file pointers as a localized concept, purely so that file access looks and feels more POSIX-like. it's all for the vibe, okay? and the best part: no packets are exchanged with the server during a seek operation. zero. none. the server literally doesn't hear about it. the localized file pointer just sits there being a convenient offset for your read/write operations later. iconic behavior honestly π
π¨ BIG WARNING, FR FR, READ THIS TWICE π¨ You MUST NOT seek during writing or reading a file with SFTP. like, don't. the internals are out here juggling outstanding packets, and changing the "file position" while stuff is in transit will result in badness. not the cute kind of badness. the actual kind. π
β AVAILABILITY β
Added in 1.0 β so she's been around a minute, an OG fr fr π
π SEE ALSO π
libssh2_sftp_open_ex(3)β go get yourself a handle first, bestie, you can't seek without one π
and that's the whole page!! this one's from the libssh2 manual, dated 22 Dec 2008 β yeah, 2008, she's vintage and still slaying π mwah, go read the docs, ily π«Άπ
π¦ where this page comes from
- alpine 3.22: libssh2-doc 1.11.1-r3 Β· BSD-3-Clause
- alpine 3.23: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- alpine 3.24: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- arch rolling: libssh2 1.11.1-7 Β· BSD-3-Clause
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u1 Β· BSD3
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u2 Β· BSD3
- epel 10: libssh2-docs 1.11.1-9.el10_3 Β· BSD-3-Clause
- epel 9: libssh2-docs 1.11.1-9.el9 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-4.fc43 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-9.fc43 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-5.fc44 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-9.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- ubuntu questing: libssh2-1-dev 1.11.1-1build1
- ubuntu questing: libssh2-1-dev 1.11.1-1ubuntu0.25.10.2
- ubuntu resolute: libssh2-1-dev 1.11.1-1build2 Β· BSD3
- ubuntu resolute: libssh2-1-dev 1.11.1-1ubuntu0.26.04.4 Β· BSD3
- ubuntu stonking: libssh2-1-dev 1.11.1-6 Β· BSD3
- π the page's license: BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms