在 macOS 上创建临时文件时出错
Om mac OS 10.6.7,我正在临时目录中创建一些文件。一段时间后,我开始在打开系统调用中失败,返回的错误是 24,这意味着磁盘已满。我检查了磁盘空间,仍然有 80GB 可用。临时目录有什么限制或特殊配额吗?我使用以下标志来打开文件: open(path, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)
此时 RAM 使用率相当高(大约 90%),但我认为它不会影响文件打开,特别是当它显示磁盘已满作为返回错误时。
有人遇到过这样的情况吗?
Om mac OS 10.6.7, I am creating some files in the temp directory. After a while I start getting failure in open syscall and error returned is 24 which means disk full. I checked the disk space and still 80GB is available. Are there any restrictions or special quota on temporary directory? I used following flags to open the file:
open(path, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)
The RAM usage is fairly high during this point, (around 90%), but I dont think it should affect the file open especially when it says disk full as the returned error.
Did anyone face such a situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
错误 24 是 EMFILE,意味着打开的文件太多。
Error 24 is EMFILE meaning too many open files.
此错误代码 24 针对
EMFILE
,表示当前进程已打开最大文件数,因此现在无法打开更多文件。因此,请更改系统中每个进程打开文件的最大限制,或者如果可能的话尝试在使用后关闭文件,那么
如果我记得的话,一个进程中一次打开的最大文件默认为 20 个。
this error code 24 is for
EMFILE
which indicates that maximum files are already open by current process so now more files can not be opened. So changes some how the maximum limit of opened file per process in your system or try to close files after usages if possible then
if i remember then maximum files open at a time in one process is 20 by default.