I'm using the tinyDir header available here:
https://github.com/cxong/tinydir
The problem is, every time I open a folder to find the directories/files inside it, there are always 2 elements that appear to be files, but are not.
The code I use:
tinydir_dir dir;
int i;
tinydir_open_sorted(&dir, directory.c_str());
for (i = 0; i < dir.n_files; i++)
{
tinydir_file file;
tinydir_readfile_n(&dir, &file, i);
printf("%s", file.name);
if (file.is_dir)
{
printf("/");
}
printf("\n");
}
tinydir_close(&dir);
If I use a path like: C:\\test and that folder only has 1 file in it, the output is:
./
../
file.txt
The first 2 elements appear to be some kind of path to parent directories. Why do the first 2 lines appear?