Gertboard

Jay Vaughan EMAIL HIDDEN
Sat Jan 28 11:51:47 CET 2012


>> Absolutely nothing wrong with doing it this way .. In fact I'd say it's helpful to the beginner that they can see shell code being used that way..
> 
> No, it's just plain wrong.

Says you.  I'd say you're quite wrong.

> Where a simple function would have sufficed, opening a file, writing a character and closing it, he uses a convoluted and hugely inefficient manner.

There is nothing inefficient about doing this on an embedded, single-user system, Peter.  Its quite fine to do it and allows for *education* of the end-user as well.

> I mean, if even you don't know that a system() call does a fork(), how is a beginner supposed to know that this is not the way to write a character to a file in an embedded system?

I know a system() call does a fork(), but I also know that forks are not that inefficient as you seem to think they are.. A single system("echo 1 > /proc/somewhere") is far more educational than a full-blown fopen()/fwrite()/fclose() and all the error handling that entails.  I mean, come on, seriously .. you're just looking for something to prove your 'professionalism' when really its not even warranted in this case.  A system() call to echo is perfectly fine - to the newbie user, it will be educational ("Oh, I can also issue that echo at the cmd line too, neat..") as well as fully workable.

In short: P'shaw to your know-best.


;
--
Jay Vaughan







More information about the music-bar mailing list