|
◆ filesystem_tree_add_file()
- Brief Description:\n Adds a file to the filesystem tree.
This function creates a new file node under the given _root node.
- Parameters
-
_root | A pointer to the root filesystem_tree_node_t. |
_path | The path of the directory where the file will be added. |
_file_path | The file path of the file to add. |
_entry | The pak_entry_t associated with the file. |
Definition at line 132 of file filesystem_tree.c.
134 if (!_root || !_path || !*_path)
137 char* dir_path = strdup(_path);
138 char* dir_name = strtok(dir_path, "/");
139 char* file_name = NULL;
144 file_name = strtok(NULL, "/");
149 found = _add_directory(current, dir_name);
152 dir_name = file_name;
158 if (dir_name && !file_name)
159 _add_file(current, dir_name, _file_path, _entry);
Referenced by gpak_add_file().
|