Skip to content
slaeshjag edited this page Mar 24, 2013 · 13 revisions

libDarnit uses a few formats not found anywhere else. There's mostly no reason for this other than "why not." Support tools for working with them are mostly available though.

LDI

A LDI file "libDarnit Image" is a file container clumping multiple files together into one. It is mainly to reduce clutter without needing massive directory hierarchies. Like zip, an LDI can be opened even if it's appended to another file (that isn't a LDI) since the necessary info about it is also located at the end of the file.

To access a file inside an LDI, you need to mount the LDI. This adds all the files in the LDI to the VFS that darnit-filesystem looks in when you try to open a file. All functions except the dynlib functions can trasparently access files in mounted LDI files.

Creating a LDI file

To create a LDI file, it is recommended that you use the with libDarnit provided utility called darnit-fsimage. It adds all the files in a directory to a LDI. Inside the LDI, the file appear under the directory you added them from.

For example, if you run darnit-fsimage directory directory.ldi, the file directory.ldi will be created containing the files in directory. If you have a file called file1.blargh inside directory, after that you mount directory.ldi, you can open it by calling d_file_open with directory/file1.blargh as fname.

Clone this wiki locally