Today I came across a very little command which will create playlist based on files in current folder. I just had to put it to my blog.
It is very easy. Open terminal. Go to desired directory and execute this:
ls *.mp3 |sort > playlist.m3u
Files are also automatically sorted by name.