Why do we need a format for binary executable files
When binary files (i.e. executables) are saved they usually have a format (e.g. ELF or .out) where we have a header containing pointers to where data or code is stored inside the file. But why don’t we store the binary files directly in the form of sequence of machine instructions.
Why do we need to store data separately from the code?
Secondly when the assembler creates a binary file is the file is among the above formats?
Why do filesystems read and write in blocks?
I read that file systems usually access data in blocks, whose size is integral multiple of disk block size. Why don’t they read individual disk blocks?
Is it safe to store application files to user’s temp directory?
I’m developing a Node.js library that collects data whenever user runs tests. I would like to persist the data on local disk so that after the test run, user can run a command accessing that data. The test data might potentially contain sensitive data depending on what the user is testing, such as API keys (if the user is accidentally using real API keys for testing).