- Home /
filename extension convention?
So I have a save file using binary serialization to make a save file for my game. My question is that what is the file extension naming convention for such a case? is it .dat? I've seen a lot of games using that, and was asking if that is appropriate. Of course, I can just invent some file extension, but just wanted to ask if there are some conventional extension names that I should consider using.
Answer by Bunny83 · Jan 27, 2019 at 01:07 PM
No, there are no real standards. It depends on if a human actually has to handle those files or not. If they are just read / written by a software it doesn't matter at all. You can even omit the extension (which is often the case on Unix / Linux). Though since we're no longer forced to "8:3" names we could even use a "domain like" file name to further specify it's type (if that's necessary) or use extensions longer than 3 characters. Arbitrary binary data commonly uses "dat" or "bin". Though since "bin" is often used for raw disc images it often causes confusion.
There are a lot websites which list commonly known usages of file extensions. Pretty much every 3 character extension has more than one usage. So it may just be a hint what that file might contain but doesn't guarantee it. Most know that ".max" is the extension of a 3ds Max 3d model. However it has several other known usages. So when seeing a max file you can't be sure what it actually contains.
Long story short: Use whatever you like. but you want to avoid using extensions which belong to an actual standard (like BMP, PNG, JPG, EXE, DLL, ...). Using such files would just confuse the user and antivirus software when they search for files.
Your answer
Follow this Question
Related Questions
Need Suggestion : 2D Entering and leaving building 0 Answers
Having runtime functionality and editor extension in one script 1 Answer
How do I change a file extension programmatically? 1 Answer
UIExtensions - LineRenderer not updating 1 Answer
FileStream + BinaryFormatter from C# to iOS doesn't work? 2 Answers