使用WinInet的方法迭代缓存文件时,如何跳过大文件?
我的程序的一部分使用WinInet的缓存功能(例如FindFirstUrlCacheEntry、FindNextUrlCacheEntry)来遍历系统缓存并删除满足特定条件的文件。
问题是,当在缓存中找到大文件时,FindNextUrlCacheEntry 会因 ERROR_INSUFFICIENT_BUFFER 失败,并请求不合理的缓冲区大小继续(超过 10MB),而我无法在该系统上分配该缓冲区大小。
我需要一种方法: - 跳过大文件(以某种方式到达下一个条目) - 在不分配大缓冲区的情况下获取大文件的缓存条目
我注意到“检索”缓存功能,但它们都需要 URL - 我什至无法获取我的条目的 URL...
有什么建议吗?
谢谢, 古浦
A part of my program uses WinInet's caching function (e.g. FindFirstUrlCacheEntry, FindNextUrlCacheEntry) to go through the system cache and delete files that meet certain criteria.
The problem is that when a large file is found in the cache, FindNextUrlCacheEntry fails with ERROR_INSUFFICIENT_BUFFER, and requests an unreasonable buffer size to continue (over 10MB), which I fail to allocate on that system.
I need a way to either:
- Skip large files (somehow get to the next entry)
- Get the cache entry of large files without allocating a large buffer
I noticed the "Retrieve" cache functions, but they all require URLs - and I can't even get the URL of my entry...
Any suggestions?
Thanks,
Guypo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明这是我的错误,WinInet 实际上并没有尝试读取完整的文件。
尽管如此,跳过文件的方法可能还是有用的......
Turns out it was my bug, WinInet doesn't actually attempt to read the full file.
Still, a way to skip files could have been useful...