C ++和Visual C ++中的文件管理 [英] File managment in C++ and visual C++

查看:121
本文介绍了C ++和Visual C ++中的文件管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

同时打开的文件数量是否有限制?一次可以打开多少个文件?

Is there any limitation in number of opened file at a same time? How many files could be open at a time? Is there any limitation related to the hard disk in writing data blocks in a file?

推荐答案

您会在这里找到答案
You will find your answer here http://msdn.microsoft.com/en-us/library/6e3b887c.aspx[^]


如果您要遇到任何系统限制,这是软件设计问题的一个好兆头.
如果您有理由打开许多文件,我希望看到它.可能存在更合理的方法.

—SA
If you''re about to hit any system limitation, it is a good sign of the problem of your software design.
If you can justify opening many files, I would like to see it. It is likely that a more reasonable approach exists.

—SA


Vishal上面提到了一个C运行时间限制(您可以将其值设置为2048).根据操作系统的不同,此操​​作可能会或可能不会起作用.如果操作系统的每个进程的最大限制小于此限制,则将其设置为2048不会有帮助.同样,如果操作系统有更高的限制,您仍然无法利用它.

实际上,您的应用很可能在达到此限制之前就before住了.通常,请尽量不要耗尽操作系统资源的最大数量.
There is a C run time limit that Vishal has mentioned above (you can set its value up to 2048). Depending on the OS, this may or may not work. If the OS''s max limit per process is less than that, setting it to 2048 won''t help. Simuilarly, if the OS has a higher limit, you still can''t take advantage of that.

Realistically speaking, your app will most likely choke way before you hit this limit. In general try not to use up OS resources to their max limit.


这篇关于C ++和Visual C ++中的文件管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆