Elysia is coding against POSIX?
I apologize for that huge banging sound you just heard -- that was my jaw hitting the floor.
Anyway, to comprehend the weird arguments to execlp(), think of it this way: the first parameter is the program to execute, that part is obvious. The following parameters will be used to populate the argv array of the newly executing program. As we know, the first entry in argv should be the name of the program itself, thus you pass it there as well. And the function has a variadic signature, so the compiler is unlikely to catch mistakes when calling it.
And.. in those moments you're thinking "POSIX really sucks..." Yeah, it does ;)
It's a required assignment, so there is not much I can do.
Originally Posted by brewbuck
Don't worry. I accept your apology XD
Regarding execlp... that was my mistake. I didn't consider the first argument is the name/path of the process itself. I knew that, of course, but I forgot to pass that in as the first argument.
Actually, POSIX functions are very easy to call and use, which is nice compared to Windows. It just goes to show how much of a mess the Win32 API is.
I suppose I could use execvp, but execlp is more convenient!
That's true.. But I think the two APIs suck for different reasons. Win32 because it's so big and complicated, POSIX because it's too simple. You can accomplish almost anything in either one, but you'll be pulling your hair out for different sorts of reasons, depending.
Originally Posted by Elysia