FILEREAD(3)

πŸ“¦
version 2022.10.16 Β· 2 versions
, in opensuse-leap 16.0

πŸŽ€ fileread() β€” reads file into buffer πŸŽ€

okay so bestie, welcome to FILEREAD(3) from SchilyΒ΄s LIBRARY FUNCTIONS. this is the whole vibe: read bytes from a file straight into your buffer. let's go πŸ’…

✨ NAME ✨

fileread() - reads file into buffer

πŸ¦‹ SYNOPSIS πŸ¦‹

int fileread(f,buf,size)
FILE *f;
char *buf;
int size;

🌸 DESCRIPTION 🌸

okay so fileread() reads up to size bytes from the file into buf. the number actually read may be smaller if end-of-file is reached. the file pointer (implied) is left pointing to one past the last character read. no cap, that's the whole behavior. 🫢

πŸ’– RETURNS πŸ’–

  • > 0 β€” the number of bytes actually read.
  • = 0 β€” file was at end-of-file.
  • < 0 β€” error code.

it returns the number of bytes actually read or an error code. periodt.

πŸ”₯ NOTES πŸ”₯

bestie, listen: the buffer must be at least size long. if reading from a "raw" device, size must be a multiple of 512.

that's the whole page, bestie. signing off from SchilyΒ΄s LIBRARY FUNCTIONS β€” source/version vibe: 2022/09/09, by Joerg Schilling. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from