RECOVER(6)

πŸ’Ύ RECOVER(6) β€” the games manual page, bestie edition ✨

okay so picture this: it's RECOVER(6), from the Games Manual section, and she is here to save your NetHack run from the absolute void. buckle up πŸŽ€


🌸 NAME 🌸

recover β€” the girl who recovers a NetHack game that got interrupted by disaster πŸ’…


✨ SYNOPSIS ✨

recover [ -d directory ] base1 base2 ...

πŸ’– DESCRIPTION πŸ’–

okay so like, every once in a while a NetHack game gets straight-up interrupted by disaster when the game or the whole system crashes 😭. before NetHack v3.1, those games were just… gone. lost. deceased. because stuff like the player's inventory was only ever kept in memory 🫠.

but NOW? all the pertinent information can be written out to disk, so those games can be recovered at the point of the last level change. slay πŸ’…βœ¨

so the base options tell recover which files to process. each base option specifies recovery of a separate game β€” one base, one game, no mixing, iykyk.

then there's the -d option, which β€” and this is important, bestie β€” must be the first argument if it appears 🫢. it supplies a directory which is the NetHack playground. it overrides the value from NETHACKDIR, HACKDIR, or the directory specified by the game administrator during compilation (usually /usr/games/lib/nethackdir).

NetHack normally writes out files for levels as the player leaves them, so they'll be ready for return visits πŸ”. when checkpointing, NetHack also writes out the level entered and the current game state on every level change. this naturally slows level changes down somewhat β€” small price, big vibes 😌.

now, the level file names are of the form base.nn, where nn is an internal bookkeeping number for the level πŸ”’. the file base.0 is used for game identity, locking, and, when checkpointing, for the game state. various OSes use different strategies for constructing the base name:

  • πŸ–₯️ microcomputers use the character name, possibly truncated and modified to be a legal filename on that system
  • πŸ‘₯ multi-user systems use the (modified) character name prefixed by a user number to avoid conflicts, or "xlock" if the number of concurrent players is being limited

it may be necessary to look in the playground to find the correct base name of the interrupted game πŸ‘€. recover will transform these level files into a save file of the same name as nethack would have used. iconic behavior, honestly πŸ‘‘

⚠️ okay so this part is serious: since recover must be able to read and delete files from the playground and create files in the save directory, it has interesting interactions with game security πŸ’€. giving ordinary players access to recover through setuid or setgid is tantamount to leaving the playground world-writable β€” with respect to both cheating and messing up other players. no cap, that's the whole drama.

for a single-user system, this of course does not change anything, so some of the microcomputer ports install recover by default πŸ“.

for a multi-user system, the game administrator may want to arrange for all .0 files in the playground to be fed to recover when the host machine boots, and handle game crashes individually. if the user population is sufficiently trustworthy, recover can be installed with the same permissions the nethack executable has. in either case, recover is easily compiled from the distribution utility directory πŸ› οΈβœ¨


πŸ¦‹ NOTES πŸ¦‹

like nethack itself, recover will overwrite existing savefiles of the same name πŸ™ˆ. savefiles created by recover are uncompressed; they may be compressed afterwards if desired, but even a compression-using nethack will find them in the uncompressed form. so like… you can zip her, but she doesn't need it πŸ’œ


πŸ‘€ SEE ALSO πŸ‘€


πŸ’€ BUGS πŸ’€

recover makes no attempt to find out if a base name specifies a game in progress 😬. if multiple machines share a playground, this would be impossible to determine. so, yeah, that's just how it is.

recover should be taught to use the nethack playground locking mechanism to avoid conflicts. noted. on the list. someday. 🫠


this file is Copyright (C) Kenneth Lorber, 2024 for version NetHack-5:1.12. NetHack may be freely redistributed. see license for details πŸ“œ


and that's the whole page, bestie!! 🫢 this little number comes to you from the fine folks at NETHACK, dated 26 April 2026, and yes β€” she's still filed under RECOVER(6) at the bottom, because some things never change πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from