snfetch,v0.3.8(8)

πŸ’– snfetch β€” bestie edition πŸ’–

okay so this is snfetch,v0.3.8(8), straight out of the System Manager's Manual, and it's literally the girl whose whole job is fetching articles. sit down, hydrate, and let's get into it 🫢


✨ NAME ✨

snfetch β€” fetch articles. that's it, that's the vibe. πŸ’…


🌸 SYNOPSIS 🌸

snfetch [-r] [-t timeout] [-c depth] group [serial [max]]

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, and it's important: snfetch expects to read NNTP from file descriptor 6, and write NNTP to file descriptor 7. those two descriptors have to already be open before you even look at this program. not optional. not a suggestion. already open. πŸ”₯

Articles that get retrieved go out to descriptor 1. and every single article is separated from the next one by a dot on a line by itself. that's the little punctuation between them, no cap.

these articles are NNTP safe, which means double-dot unquoting is not done, and all lines end in CR-LF. periodt.

snfetch expects to begin its NNTP speech by giving the GROUP command. and listen β€” the upstream server's greeting must have already been read some other way. not by this program. somebody else's problem, bestie. πŸ™ˆ likewise, when snfetch is done, it will not send a QUIT command. it just... leaves. main character exit. πŸ’€

the output is suitable for feeding to snstore. that's the whole point of the fit, honestly.

snfetch always checks the article ID of the prospective article before retrieving it. if the ID already exists in the ID database, the article will not be retrieved. BUT β€” and this is the fine print, don't skip it β€” note that this does not guarantee that all articles retrieved will be unique. 😭

snfetch does not guarantee to leave the NNTP conversation in a decent state. there might be more data to read, but snfetch aborted part way. it's giving chaotic departure. it's fine. it's not fine, but it's fine.

you will need to be root or own /var/spool/sn in order to run this program. so like, get permission first, don't just walk in. πŸ‘‘

and one more: it is not safe to direct the output of several snfetches to the same pipe descriptor. but a file descriptor is all right. yes those are different. yes it matters. iykyk. ✨


πŸŽ€ OPTIONS πŸŽ€

  • -t timeout β€” snfetch will wait only timeout seconds (default 180) for data before giving up, if the server doesn't respond. it's the patience setting. 180 is already a lot of patience, ngl. ⏳
  • -r β€” output in news batch format instead. all articles will take the #! rnews form only, even if there is just one article, all lines end in bare linefeed, and dot-unquoting is performed. so basically the opposite of the default vibe. 🌈
  • -c depth β€” employ a command pipeline of depth depth. NNTP command pipelining is not officially sanctioned, so by default no pipeline is used. however, a pipeline with a depth greater than 0 will substantially reduce transaction latency if the server accepts it. a respectable value for depth might be between 1 and 5. live a little, but not too much. πŸ’…

πŸ’œ ARGUMENTS πŸ’œ

snfetch takes the name of a single newsgroup on its command line.

  • if serial is given, this is taken to be the first article number on group on the server to fetch. 🐣
  • if max is specified, this is taken to be the maximum number of articles to fetch. the first article retrieved may be after serial if max would be violated. yes, it can skip ahead. no, it doesn't ask. πŸ™ˆ
  • if max is not specified, there is no limit. go off, i guess. πŸ”₯

🧚 ENVIRONMENT VARIABLES 🧚

  • SNROOT β€” if this is set and is not empty, the value is used in place of /var/spool/sn, the default news spool directory. so like, if you wanna live somewhere else, set it. and it has to be non-empty, empty string doesn't count. ✨

πŸ’– FILES πŸ’–

  • /var/spool/sn/newsgroup/.serial β€” if serial is not specified, the starting serial number is taken from the file /var/spool/sn/newsgroup/.serial. this defaults to 0 if the file can't be read. no file, no drama, just zero. 🌸
  • /var/spool/sn/newsgroup/.serial.tmp β€” if snfetch exits with success (0), the new serial is written into this file. the original file /var/spool/sn/newsgroup/.serial is readonly by snfetch. it does not touch the original. hands off. πŸ™…β€β™€οΈ
  • /var/spool/sn/newsgroup/.max β€” if max is not specified on the command line, max is read from this file. if the file cannot be read or does not exist, there is no limit. πŸ¦‹

⭐ EXIT CODES ⭐

snfetch exits:

  • 1 on usage error
  • 2 on system failure
  • 3 on protocol error
  • 4 on read timeout
  • 0 on success πŸ‘‘

so if you see a 4, the server was just ghosting you. rude. πŸ’€


🌈 SEE ALSO 🌈

snstore (8), snget (8) β€” go read those too, bestie, they're the rest of the friend group. 🫢


and that's the whole page!! N.B. this beautiful thing was written by Harold Tay, and it's snfetch,v0.3.8(8) β€” yeah, version 0.3.8, we love a specific queen. tysm for reading, go fetch some articles, and remember: file descriptors 6 and 7, already open, or it's not happening. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from