I have a function that returns a list of all directories which are in a certain directory. But my problem is that the first and second item of that list always contain respectively the directory "." and ".." . I can't figure out why, and when I was trying to make a workaround. The workaround is that it checks if the first character is '.', but that causes an debug assertion errormessage.
This is the code which I made to return that list:
How long have you been using computers??
You do know that . and .. are used by the system to represent the current directory and parent directory respectively????
What is the point in defining a OS_WINDOWS when the OS itself already defines such a variable?
@topic: If you ever run ls or dir on a *nix or Windows system, you'll notice that it returns "." and "..". You can choose to leave it out by checking to see if it's called "." or ".." but it's more of a hassle and should probably be left in.
What is the point in defining a OS_WINDOWS when the OS itself already defines such a variable?
Ah, I didn't know that, does all OSes already define one?
@topic: If you ever run ls or dir on a *nix or Windows system, you'll notice that it returns "." and "..". You can choose to leave it out by checking to see if it's called "." or ".." but it's more of a hassle and should probably be left in.
I made this function skip the first two directories, that helps too.