Sometimes, you might want to have a single script that is capable of reading in multiple file types. For example, if you were building a complex system to build character rigs, you might want to have one custom format that holds information about default bone layouts and another type that stores information about animation settings, allowing the user to mix and match any two files.
In such cases, you might want your script to handle files with multiple extensions—one for each type of data. In this example, we'll look at how to do that by creating a script that can be used to read either FOO (our example text-based format) or FOB (our example binary format).
Make sure that you have at least one file of each type. For FOO files, you can just create them directly in a text editor. For FOB files, it's best to use the script in the writing binary files example.