Solved

C++ DEVELOPER: Compound Files

Posted on 1998-12-29
6
594 Views
Last Modified: 2008-03-04
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?
0
Comment
Question by:rayb
  • 3
  • 3
6 Comments
 
LVL 2

Expert Comment

by:benten
Comment Utility
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?
0
 
LVL 2

Author Comment

by:rayb
Comment Utility
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?

0
 
LVL 2

Expert Comment

by:benten
Comment Utility
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.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 2

Author Comment

by:rayb
Comment Utility
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
0
 
LVL 2

Accepted Solution

by:
benten earned 20 total points
Comment Utility
Why not just develop such a system yourself.  All that seems to be required is a directory structure and a way to store files.  Several programs already do this.  You might develop them into a more generic library.  Try looking at the source for GNU "tar" and "cpio".  I know that RedHat's "rpm" (RedHat Package Manager) uses "cpio" style packaging.  I recommend this method if you cannot find any other existing system.  You might also consider compression (e.g., "gzip" or "bzip2").
0
 
LVL 2

Author Comment

by:rayb
Comment Utility
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

0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now