Also, data may be a network away. Most systems let you organize files into a tree structure, so have directories and files. Meaning of a file depends on the tools that manipulate it. Meaning of a Latex file is different for the Latex executable than for a standard text editor. Object file format has meaning to linker.
Some systems support a lot of different file types explicitly.
Macintosh, IBM mainframes do this. Knowledge of file types built into OS, and OS handles different kinds of files differently. In Unix, meaning of a file is simply a sequence of bytes. Start with Unix executable magic number. Recall Nachos object file format.