Program files larger than 2 GB using C # .Net

How to write large content to disk dynamically using c sharp. Any tips or links are welcome.

I am trying to create a file (custom format and extension) and write to it. The user will download the file, and its contents will be converted to a stream of bytes and written to the file (filename.hd). Indexing downloaded files is done in another file (filename.hi).

This is great for me, when the file size "filename.hd" is 2 GB, if it exceeds 2 GB, it does not allow me to add content. That's my problem.

After googling, I found that a Windows FAT 32 based system (most versions) only supports 2 GB of file size. Is there any solution for me to handle this situation. Please let me know.

Thanks in advance Sree

+2
source share
3 answers

Use a different file system (e.g. NTFS)?

+6
source

Use StreamWriter to burn to disk. StringBuilder is recommended to create a string, because when using a "string" that adds two lines, a new line is really created, which harms the preliminary work.

0
source

Well, you will have some non-code restrictions: File system - FAT and FAT32 will limit you. Whether the system is 16, 32 or 64 bit will set limits for you.

0
source

Source: https://habr.com/ru/post/1386350/


All Articles