Open source embedded filesystem (or single fil

2020-02-17 07:03发布

I'm not sure what the "general" name of something like this might be. I'm looking for a library that gives me a file format to store different types of binary data in an expanding single file.

  • open source, non-GPL (LGPL ok)
  • C interface
  • the file format is a single file
  • multiple files within using a POSIX-like file API (or multiple "blobs" within using some other API)
  • file/structure editing is done in-place
  • reliable first, performant second

Examples include:

Problems with the above:

  • whefs doesn't appear to be very mature, but best describes what I'm after
  • HDF, CDF, NetCDF are usable (also very reliable and fast), but they're rather complicated and I'm not entirely convinced of their support for opaque binary "blobs"

Edit:
Forgot to mention, one other relevant question:
Simple Virtual Filesystem in C/C++
Another similar question:
Is there an open-source alternative to Windows compound files?

Edit:
Added condition of in-place editing.

Edit:
whefs superseded by: whio_epfs

5条回答
女痞
2楼-- · 2020-02-17 07:35

What about BerkeleyDB? It's not exactly a filesystem but it's quite transparent to store 'binary data' in a file. License seems to be quite permissive as well.

查看更多
▲ chillily
3楼-- · 2020-02-17 07:39

It sounds like you're talking about the Linux loopback device, which lets you treat a file on a filesystem as a first-class block device (and then proceed to mkfs, mount, etc.)

(What sort of platform are you targetting? A fully-featured Unixlike? Something in the embedded space with a small footprint?)

查看更多
Melony?
4楼-- · 2020-02-17 07:42

This appears to do what I was looking for: libgsf

Still need to test its reliability/performance and how cross-platform the binary format is.

查看更多
相关推荐>>
6楼-- · 2020-02-17 07:54

The WxWindows library supports ZIP files (see http://docs.wxwidgets.org/stable/wx_wxarc.html#wxarc). This has also the advantage that you can look at the contents using a ZIP manager (e.g. WINZIP).

A commercial alternative is ChillKat (http://www.chilkatsoft.com/)

If security is a concern, encrypt the file contents and mangle the file names in the ZIP archive.

查看更多
登录 后发表回答