Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to convert a folder & it's contents (files & sub-folders) to a single stream which will be returned to some application. The problem is that I cannot compress the folder. Now, I want to know that whether there's a way to modify the attributes or type of a folder so that it will be treated as a single but unknown file. So that I can read it using a single FILESTREAM object.

Another way that I could think of is to return an array of stream which will contain the stream of all the files inside the root folders & sub-folders. Along with that a text/xml file also in stream, which will store the location of each file inside the Stream array.
Posted

1 solution

The best way would be to create some class that would return all the data as a stream. Inside the class you would iterate through all the files and read their data from disk, passing it back to the caller. The only issue would be how you identify the end of one file and the beginning of another.
 
Share this answer
 
Comments
piyush_singh 17-Jun-13 10:20am    
It is for this I decided initially to go for the Array of Streams where an index of an array represents a single file only. Along with that the 1st index of the Array will contain the Stream of a comma delimited String data type which will contain the physical location of each file so that at the time of parsing, i will read a files path (including it's name) from the string and subsequently the file will be parsed by another application. Still not very sure whether it will work or not. Thanks for the advice anyways.
Richard MacCutchan 17-Jun-13 12:26pm    
The only thing I can suggest is that you try it, as it is not very clear what you are actually trying to achieve with this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900