XDF_SEEK(3)
π XDF_SEEK(3) π
okay so bestie, we're in the xdffileio library manual and today's main character is xdf_seek β the glow-up move that slides your sample pointer around inside a xDF file. no cap, this is the one you want when you're like "take me to sample 5000 pls" and the file is like "say less" π
β¨ NAME β¨
xdf_seek β move the sample pointer of a xDF file π¦
π SYNOPSIS π
#include <xdfio.h>
off_t xdf_seek(struct xdf* xdf, off_t offset, int whence);
π DESCRIPTION π
So xdf_seek() repositions the current sample pointer according to the couple (offset, whence) β and whence can be any of these three icons:
SEEK_SETβ the offset gets set tooffsetbytes. fresh start energy, we're going exactly where you said π―SEEK_CURβ the offset gets set to its current location plusoffsetbytes. it's giving "nudge me from where I'm standing" πΆβοΈSEEK_ENDβ the offset gets set to the size of the file plusoffsetbytes. measuring from the very end, dramatic much π
k so important: the file referenced byxdfshould have been opened with modeXDF_READ, andxdf_prepare_arrays(3)should have been successfully called on it. no prep, no seek, that's just how it is πΈ
π₯ RETURN VALUE π₯
Upon successful completion, xdf_seek() returns the resulting offset location β measured in number of samples from the beginning of the recording (yes bestie, samples, not bytes, don't let anyone gaslight you). Otherwise, a value of -1 is returned and errno is set to indicate the error. classic π
π ERRORS π
EINVALβxdfisNULLorwhenceis none of the allowed values. like hello?? pick a real whence πEPERMβ no successful call toxdf_prepare_transfer(3)have been done onxdf, or it has been opened using the modeXDF_WRITE. you skipped the ritual, so no pointer movement for you π«ERANGEβ the requested offset is out of the range of the recording. you aimed past the end of the timeline, girlie π«EINTRβ the call was interrupted by a signal before any data was read; seesignal(7)β‘EIOβ a low-level I/O error occurred while reading from the inode πESTALEβ Stale file handle. This error can occur for NFS and for other file systems π
π¦ SEE ALSO π¦
and that's the whole vibe check, bestie π this page comes to you from EPFL, dated 2010, and it lives in the XDF_SEEK(3) slot of the manual β go forth and seek responsibly, mwah π
β¨π
π¦ where this page comes from
- debian bookworm: libxdffileio-dev 0.3-4 Β· LGPL-3.0-or-later
- debian trixie: libxdffileio-dev 0.3-4+b2 Β· LGPL-3.0-or-later
- fedora 43: xdffileio-devel 0.3-23.fc43 Β· LGPL-3.0-or-later
- fedora 43: xdffileio-devel 0.3-23.fc43 Β· LGPL-3.0-or-later
- fedora 44: xdffileio-devel 0.3-24.fc44 Β· LGPL-3.0-or-later
- fedora 44: xdffileio-devel 0.3-24.fc44 Β· LGPL-3.0-or-later
- ubuntu jammy: libxdffileio-dev 0.3-4 Β· LGPL-3.0-or-later
- ubuntu noble: libxdffileio-dev 0.3-4ubuntu3 Β· LGPL-3.0-or-later
- ubuntu questing: libxdffileio-dev 0.3-4ubuntu3
- ubuntu resolute: libxdffileio-dev 0.3-4ubuntu4 Β· LGPL-3.0-or-later
- ubuntu stonking: libxdffileio-dev 0.3-4ubuntu4 Β· LGPL-3.0-or-later
- Copyright 2010 (c) EPFL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms