It's possible, but it means you have to provide some sort of organization to your file.
For your data, you could organize your file thus:
unsigned integer: number of node1's
(
char[496]: node1.filename
unsigned integer: node1.contentAddress (this is an index into this the next list)
)
... (repeat as many times as there are 'node1's)
unsigned integer: number of node3's
(
char[1020]: node3.content
unsigned integer: node3.nextContent (this is an index into this list)
)
... (repeat as many times as there are 'node3's)
|
The indices are simply numbers like 0, 1, 2, ... that index a particular node in its list.
For example, if node1.contentAddress (in the file) is 2, then the, content can be found in the third (index == 2) element of the list of node3 items in the file.
To put it another way, instead of writing a pointer to memory to file, write an index to the item in the file.
This takes a little care when writing and reading the file, but it is not difficult.
Hope this helps.
[edit] Fixed typo