- Brief Description:\n Finds a file in the filesystem tree.
This function searches for a file node with the specified path in the filesystem tree.
- Parameters
-
| _root | A pointer to the root filesystem_tree_node_t. |
| _path | The path of the file to find. |
- Returns
- A pointer to the found file node or NULL if not found.
Definition at line 185 of file filesystem_tree.c.
186 if (!_root || !_path || !*_path)
189 char* dir_path = strdup(_path);
190 char* dir_name = strtok(dir_path,
"/");
191 char* file_name = NULL;
196 file_name = strtok(NULL,
"/");
207 dir_name = file_name;
214 if (dir_name && !file_name)
215 file = _find_file(current, dir_name);
Referenced by gpak_find_file(), and gpak_fopen().