Fetch file index
Last updated
Was this helpful?
Last updated
Was this helpful?
The app fetches the file index associated with your user prefix. Each Markdown file you create is stored inside a new . The ID of each file is based on your user prefix and the filename. Your file index contains the names of all your files. Individual files can be fetched using your user prefix and the filename.
The app obtains a data ID handle for the unversioned structured data (type tag 500) that contains your file index.
The name of your file index is based on your user prefix and the string "#index".
The app tries to obtain a structured data handle using the data ID handle of your file index.
The app stores the structured data handle in a global variable.
The app tries to read the structured data that contains your file index using the structured data handle previously obtained.
If the app is able to read the structured data, it parses your file index and stores it in a global variable.
If the app is unable to read the structured data, it means that your file index hasn't been created yet. Therefore, the app will create an unversioned structured data (type tag 500) with an ID based on your user prefix and the string "#index". Your file index is encrypted using the cipher options handle previously obtained.
The app saves your file index by sending a PUT request to the SAFE Network.
Finally, the app stores your file index in a global variable.