Solved

C++ DEVELOPER: Compound Files

Posted on 1998-12-29
6
596 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
ID: 1638989
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
ID: 1638990
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
ID: 1638991
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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 2

Author Comment

by:rayb
ID: 1638992
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
ID: 1638993
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
ID: 1638994
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

816 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

8 Experts available now in Live!

Get 1:1 Help Now