C#File.Copy没有足够的配额 [英] C# File.Copy Not enough quota
问题描述
我有一堆机器上运行大型应用程序。每隔5分钟内将文件复制到做它的一些操作。
代码工作顺利,几乎99.9%的时间,但每隔几个小时一次我可能会在这里讨论的误差
下面的代码:
试
{
File.Copy(fullPathName,readPathName,真正的);
}
赶上(例外的例外)
{
....
}
这个代码在自己的线程运行,但只应运行这些线程之一。这是我得到的错误:
试图创建.tmp文件时遇到意外的异常。没有足够的配额是可用来处理此命令。
在System.IO .__ Error.WinIOError(的Int32的errorCode,字符串maybeFullPath)
。在有System.IO.File .InternalCopy(字符串sourceFileName,字符串destFileName,布尔覆盖)
在System.IO.File.Copy(字符串sourceFileName,字符串destFileName,布尔覆盖)
。在....
块引用>
解决方案
没有足够的配额是可用来处理此命令
表示您的系统资源不足。这是很难说的问题是究竟是什么,但几乎可以肯定没有什么代码可以做,但试操作。I have a large application running on a bunch of machines. Once every 5 minutes it copies a file to do some manipulation on it.
The code works without a hitch almost 99.9% of the time but once every few hours I might get the error discussed here.
Here's the code:
try { File.Copy(fullPathName, readPathName, true); } catch (Exception exception) { .... }
This code runs in its own thread but should only be one of these threads running. Here's the error I get:
Encountered an unexpected exception when trying to create the .tmp file. Not enough quota is available to process this command.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite) at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite) at ....
解决方案
Not enough quota is available to process this command
means that your system was running low on resources. It's hard to tell what the problem was exactly, but there's almost certainly nothing your code can do but retry the operation.这篇关于C#File.Copy没有足够的配额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!