Link to home
Start Free TrialLog in
Avatar of rayb
rayb

asked on

C++ DEVELOPER: Compound Files

I'm considering porting an application from WIN32 to Linux.  My WIN32 application makes use of OLE's compound files and I'd like to know if Linux has a similar programming construct.

For anybody not familiar with OLE's compound files, it is basically a file system within a file.  The programmer can create "directories" and "files" within a single file.

Anybody?
Avatar of benten
benten
Flag of United States of America image

Current versions of Linux sport the loopback devices (no not the network loopback devices).  There is a device driver (that is often compiled as the module loop.o) that makes a file look like a block device.  This is often used to make initial ramdisks (often referred to initrds) that are used on boot to make modularized device drivers that are required to mount the root partition but thay can be used for virtually anything.

There are also a set of tools available for configuring the loopback devices.  I have a RedHat 5.2 system and I use the losetup command (I forget which package it is from).

The setup goes something like this (look at the mkinitrd script from RedHat).  Create a file the size of the filesystem you want (usually via dd).  Setup (similar to "format") the filesystem (usually via mkfs).  Configure the loop device (via losetup).  Mount the device and viola now you have a filesystem in a file!

Is this sort of what you were looking for?
Avatar of rayb
rayb

ASKER

benten,

Since posting this question, I've done some research into this subject and found some writings on a technology called OpenDoc, but it looks as though it is no longer supported...  :(

What you speak of sounds like it deserves some looking into on my part.  The procedure you outline to set one of these things up...  I'm slowly coming up to speed on Linux...  Do you know if it is possible to create one of these devices from code?  On a typical user account? Are special permissions required?

rayb: I am sure one can write a program to do such a thing but yes this procedure requires special permissions as only root can call the mount (I feel certain there are others) system calls but permissions can be worked around if you have them but do not want to give them to your users.  If you do not have them on a system where you are developing them there is a bigger problem.

These loop devices do have some limitations.  They cannot be resized easily (although you may be able to make them really huge and just compress the empty space until it is used).

I think you are really lokking for a different technology than what I described but it was the closest thing I could think of.  Sorry.
Avatar of rayb

ASKER

benton,

no, no, no...  Don't appologize.  If you would like to post another comment as an answer, I'll give you the points to pay for the time and thoughts you have given me.  Nobody else seems to be interested in this question here in this forum.

Thanks,

-Ray
ASKER CERTIFIED SOLUTION
Avatar of benten
benten
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rayb

ASKER

benton,

Thanks very much for your suggestions.  I had considered briefly using a compression library.  That would be an acceptable solution.  I'm kind of bouncing back and forth between that and a personal database technology.  It's all still in the planning and exploration stages so I've got some time to decide on which route to take.

Thanks,
-Ray