Is it opening the whole file and turning it into a BTree?
I have read the whole tutorial, I don't know C language and want to clarify, did the author opened the file and turned all of the data inside into a BTree in memory?
In the tutorial, the file organized in the form of several pages, every page could be an internal node or an leaf node, so when the program starts, it loads the file descriptor into memory and in the program there is a struct named Pagerto store all the page pointers, when you want to get a page(like when you execute select), if the pointer is null, it means never load the page before, so it allocate some memory to store the page, and if not null, it means you load it before, so it just return the page address.
So I think the author opened the file, but didn't load all the data into memory at once.