GFS_PIO_SEEK(3)

πŸ’… GFS_PIO_SEEK(3) β€” the Gfarm manual, bestie edition

okay so you opened the manual for gfs_pio_seek and honestly? you're about to eat. this is the one that repositions a stream ✨ like literally moves the little cursor in your file to wherever your heart desires. Gfarm girlies stay winning.


🌸 NAME 🌸

gfs_pio_seek β€” reposition a stream πŸ’«


πŸŽ€ SYNOPSIS πŸŽ€

#include <gfarm/gfarm.h>

gfarm_error_t gfs_pio_seek(GFS_File gf, gfarm_off_t offset, int whence,
                           gfarm_off_t * result);

✨ DESCRIPTION ✨

so gfs_pio_seek() sets the file position indicator for the file gf. main character behavior honestly πŸ‘‘

the new position is measured in bytes, and you get it by adding offset bytes to the position that whence told you about. it's giving math but make it cute.

now the whence menu, bestie, pick your fighter:

  • GFARM_SEEK_SET β†’ your offset is relative to the start of the file 🏁
  • GFARM_SEEK_CUR β†’ your offset is relative to the current position indicator πŸ“
  • GFARM_SEEK_END β†’ your offset is relative to end-of-file πŸ”š

and when result is not NULL, the new position gets returned to the address that result points at 🫢 so you get the receipts.


πŸ’– RETURN VALUES πŸ’–

  • GFARM_ERR_NO_ERROR β€” slay, it worked, the function terminated successfully ✨
  • GFARM_ERR_NO_MEMORY β€” bestie there was not enough memory available 😭
  • GFARM_ERR_INVALID_ARGUMENT β€” the whence or offset you specified is invalid πŸ’€ check ur args fr fr
  • Other β€” an error happened that isn't any of the above. the reason is shown by gfarm_error_string(3) πŸ”

πŸ¦‹ SEE ALSO πŸ¦‹

gfs_pio_create(3), gfs_pio_open(3) β€” go read those too, iykyk πŸ“š


ngl if you're passing a bad whence you're gonna get GFARM_ERR_INVALID_ARGUMENT and no amount of manifesting will fix it. vibe check ur arguments first πŸ™ˆ

and that's the whole page, periodt πŸ’…

this iconic lil manual comes from the Gfarm crew πŸ‘‘ β€” version/date stamp: Gfarm, 20 Jun 2019. take care of her, she's vintage πŸŽ€