Hey

I want to Load/read/write a big file (ISO) in C#. Ive tried various combinations (FileStream, BinaryStream, etc) but all of them give me a "OutOfMemory" exception. What is the best way to load a big file into C# to work with it?

Ill be using the DiscUtils library if its any help.

Re: Load/read/write a big file in C# 80 80

How big is the file? You are limited by how much memory you have on your system, and the 2GB data limit (if you are using .NET 4.0 or lower).

Re: Load/read/write a big file in C# 80 80

How big is the file? You are limited by how much memory you have on your system, and the 2GB data limit (if you are using .NET 4.0 or lower).

It will be a .ISO file. Max is 1GB. I dont think Ill go over that. Im running on 2GB of RAM. Im using .NET 4.5 to develop this so that limit wont exist :)

Re: Load/read/write a big file in C# 80 80

2GB of ram isn't going to give you much data space. Do you have to load the entire file at once or can you load it in parts?

Re: Load/read/write a big file in C# 80 80

2GB of ram isn't going to give you much data space. Do you have to load the entire file at once or can you load it in parts?

Im going to be adding/deleting files to and from the ISO. You tell me :)

Re: Load/read/write a big file in C# 80 80

So how can I do this?

Re: Load/read/write a big file in C# 80 80

Any comments, please?

Thank you.

Re: Load/read/write a big file in C# 80 80

Anything at all??

Re: Load/read/write a big file in C# 80 80

ISO files have a format, you'll need to understand what it is and write to that format. Deleting files will probably be the hardest part.

Wikipedia
and a simple search turned up this, which may help

Re: Load/read/write a big file in C# 80 80

Have you considered memory mapped files?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.