When we use scandir function.it will display the all the files and directories inside the directory,which we pass in the scandir function as argument.
But it also add two more element .
and ..
I want to know why these two element is showing?
When we use scandir function.it will display the all the files and directories inside the directory,which we pass in the scandir function as argument.
But it also add two more element .
and ..
I want to know why these two element is showing?
They are directories. The . is the current directory and the .. is the parent directory You can try cd into this directories like this:
cd .