programming files of size larger than 2 GB using C

2019-07-19 02:39发布

How to write large content to disk dynamically using c sharp. any advice or reference is appreciated.

Iam trying to create a file(custom format and extension)and writing to it. The User will upload a file and its contents are converted to byte stream and is written to the file(filename.hd).The indexing of the uploaded files is done in another file(filename.hi).

This works fine for me when the "filename.hd" file size is 2 GB when it exceeds 2GB it is not allowing me to add the content.This is my problem.

After googling i found that the FAT 32 windows based system (most of the versions) only support 2GB of file size.Is there any solution for me to handle this situation.Please let me know.

Thanks in advance sree

3条回答
放荡不羁爱自由
2楼-- · 2019-07-19 03:12

Use another filesystem (e.g. NTFS) ?

查看更多
老娘就宠你
3楼-- · 2019-07-19 03:17

Use StreamWriter for writing to disk. StringBuilder is recommended to create the string, since when using 'string' appending two strings really creates a new string, which hurts preformance.

查看更多
爷的心禁止访问
4楼-- · 2019-07-19 03:34

Okay you will have some restrictions that are not code related: File system - FAT and FAT32 will restrict you. Whether the system is 16, 32 or 64 bit will place restrictions on you.

查看更多
登录 后发表回答