I'm implementing mylsl.c (which is equivalent to "ls -l") method for Unix. Everything is set pretty much, except the contents of the current directory is being shown in a random order.
So the question is how could I sort the contents by filename?
I'm implementing mylsl.c (which is equivalent to "ls -l") method for Unix. Everything is set pretty much, except the contents of the current directory is being shown in a random order.
So the question is how could I sort the contents by filename?
The general solution to this problem is:
The OS does not provide a way to list them in sorted order for you.