Reputation: 8430
I'm just sort of curious: If I wanted to embed a filesystem in an executable, I assume I'd just embed an image of the filesystem using objcopy. However, what sort of filesystem should I use? Is there going to be an easy library for directly accessing the filesystem image?
I don't have any use for this, so responses like "don't do it, use actual files instead" are irrelevant.
Upvotes: 3
Views: 968
Reputation: 46040
There exist so-called virtual file system implementations, which were designed with custom storage in mind. To name a few: our Solid File System, CodeBase File System, Single File System by AidAim.
Most of them use files as the container, some (eg. our SolFS) let you have container in custom places and access it via callbacks.
Depending on practical requirements you can use ZIP or even TAR format as well.
If you want to expose the filesystem contained in your executable to the OS so that other applications could read it, then one of our virtual storage solutions (CallbackDisk or Callback File System) will do the job for you on Windows. On Linux and MacOS X there exist other ways to do this, including FUSE and MacFUSE libraries (analogs to our CBFS).
Upvotes: 2