Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

C++ DEVELOPER: Compound Files

Posted on 1998-12-29
6
597 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

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.

Question has a verified solution.

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

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…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

839 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