gpt4 book ai didi

c - "opening a file"是否意味着将其完全加载到内存中?

转载 作者:太空宇宙 更新时间:2023-11-04 01:15:21 25 4
gpt4 key购买 nike

有一个 AudioFileOpenURL 函数可以打开一个文件。使用 AudioFileReadPackets 访问该文件以读取数据包。但我脑海中浮现的一件事是:AudioFileOpenURL 是否真的将整个怪物加载到内存中?还是轻量级操作?

那么是否可以只从文件中读取特定部分的数据,而无需将整个 TB 的内容都存储在内存中?

最佳答案

Does AudioFileOpenURL actually load the whole monster into memory?

不,它只是给你一个文件指针。

Or is that a lightweight operation?

是的,相当轻巧。只需要一个文件系统查找。

So is it possible to read data from a file, only a specific portion, without having the whole terabytes of stuff in memory?

是的,您可以使用 fseek 转到文件中的某个点,然后使用 fread 将其读入缓冲区(或 AudioFileReadBytes ).

关于c - "opening a file"是否意味着将其完全加载到内存中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2750023/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com