deprecated(3)

πŸ“¦ version 3.2.0, in arch rolling

✨ NAME ✨

deprecated β€” the Deprecated List πŸ’€

Okay bestie, gather round 🫢. This is the official list of PhysicsFS functions that are still hanging around like that one group chat nobody leaves, but which you should not be using in new code. Every single one of them is a Global, and every single one has a glow-up waiting for you. Let's go through them one by one, no cap ✨


🌈 the deprecated list (read it, i'm begging)

  • PHYSFS_addToSearchPath(const char *newDir, int appendToPath) β€” As of PhysicsFS 2.0, use PHYSFS_mount() instead. This function just wraps it anyhow. Like... it's giving middleman energy πŸ’…
  • PHYSFS_enumerateFilesCallback(const char *dir, PHYSFS_EnumFilesCallback c, void *d) β€” As of PhysicsFS 2.1, use PHYSFS_enumerate() instead. And this is the important part, bestie: this function has no way to report errors (or to have the callback signal an error or request a stop), so if data will be lost, your callback has no way to direct the process, and your calling app has no way to know. 😭 Like, the errors are just out there vibing and nobody gets told. Tragic.
  • PHYSFS_getLastError(void) β€” Use PHYSFS_getLastErrorCode() and PHYSFS_getErrorByCode() instead. Two functions instead of one, but that's the upgrade path, periodt ✨
  • PHYSFS_getLastModTime(const char *filename) β€” As of PhysicsFS 2.1, use PHYSFS_stat() instead. This function just wraps it anyhow. Wrapper behavior, no thoughts of its own πŸ™ˆ
  • PHYSFS_getUserDir(void) β€” As of PhysicsFS 2.1, you probably want PHYSFS_getPrefDir(). Not a hard "never," just a "girl, that's not what you're looking for" πŸ’œ
  • PHYSFS_isDirectory(const char *fname) β€” As of PhysicsFS 2.1, use PHYSFS_stat() instead. This function just wraps it anyhow. Same story, different fname 🌸
  • PHYSFS_isSymbolicLink(const char *fname) β€” As of PhysicsFS 2.1, use PHYSFS_stat() instead. This function just wraps it anyhow. PHYSFS_stat() is the main character here, fr fr πŸ‘‘
  • PHYSFS_read(PHYSFS_File *handle, void *buffer, PHYSFS_uint32 objSize, PHYSFS_uint32 objCount) β€” As of PhysicsFS 2.1, use PHYSFS_readBytes() instead. This function just wraps it anyhow. Also, this function never clarified what would happen if you managed to read a partial object, so working at the byte level makes this cleaner for everyone, especially now that PHYSFS_Io interfaces can be supplied by the application. Byte level = clarity level πŸ¦‹
  • PHYSFS_removeFromSearchPath(const char *oldDir) β€” As of PhysicsFS 2.1, use PHYSFS_unmount() instead. This function just wraps it anyhow. There's no functional difference except the vocabulary changed from "adding to the search path" to "mounting" when that functionality was extended, and thus the preferred way to accomplish this function's work is now called "unmounting." So like, same thing, new name, glow-up complete πŸ’…βœ¨
  • PHYSFS_write(PHYSFS_File *handle, const void *buffer, PHYSFS_uint32 objSize, PHYSFS_uint32 objCount) β€” As of PhysicsFS 2.1, use PHYSFS_writeBytes() instead. This function just wraps it anyhow. And same tea as its read sibling: this function never clarified what would happen if you managed to write a partial object, so working at the byte level makes this cleaner for everyone, especially now that PHYSFS_Io interfaces can be supplied by the application. πŸ“
⚠️ Real talk though: these all still exist and they all still work (most of them are literally just wrappers), but "still works" is not the same as "should be in your new code." Use the replacements, bestie. Your future self says thank you 🫢

And that's the whole list, no gatekeeping, we ate that. πŸŽ€

This page comes to you from physfs, Version 3.2.0, and it lives in section 3 as deprecated(3). Stay deprecated-free out there, ily, bye πŸ’–πŸ§šβ­

πŸ“¦ where this page comes from