How to create file of files?

Posted by TheMachineCharmer on Stack Overflow See other posts from Stack Overflow or by TheMachineCharmer
Published on 2010-04-23T09:31:51Z Indexed on 2010/04/23 9:43 UTC
Read the original article Hit count: 234

Filed under:
|
|
class Node
{
    FooType Data; // I can save Data to file with extension .foo
    void Save()
    {
       // save Data to .foo file
    }
}

Now ,

class Graph
{
    List<Node> Nodes; 
    void Save()
    {
        foreach(Node node in Nodes)
        {
            node.Save();
        }
    }
}

Now when I invoke someGraph.Save(); then it creates Nodes.Count number of files.

I would like to appear those files as one file with extension somename.graph and be able to read it again as Nodes.

How can I do this? Is there a way to bundle files into a single different file?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET