What is the fastest way to write hundreds of files to disk using C#?
        Posted  
        
            by 
                Ehsan
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Ehsan
        
        
        
        Published on 2011-01-10T13:47:33Z
        Indexed on 
            2011/01/10
            13:53 UTC
        
        
        Read the original article
        Hit count: 255
        
My program should write hundreds of files to disk, received by external resources (network) each file is a simple document that I'm currently store it with the name of GUID in a specific folder but creating hundred files, writing, closing is a lengthy process.
Is there any better way to store these amount of files to disk? I've come to a solution, but I don't know if it is the best.
First, I create 2 files, one of them is like allocation table and the second one is a huge file storing all the content of my documents. But reading from this file would be a nightmare; maybe a memory-mapped file technique could help. Could working with 30GB or more create a problem?
© Stack Overflow or respective owner