Here you not assigning an actual path, but the actual name of the executable (argv[0]). Please, just pass the CWD:

http://www.lemoda.net/c/directory/index.html