Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Wrapping existing UNIX commands in C

Reply
Thread Tools

Wrapping existing UNIX commands in C

 
 
jacob navia
Guest
Posts: n/a
 
      07-31-2012
Le 31/07/12 23:55, tom st denis a écrit :
> On Jul 29, 1:10 pm, (E-Mail Removed) (Kenny McCormack)
> wrote:
>>
>> Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

>
> I like that you post. In case of a lull of NNTP activity you're
> useful to check if I still have net access...
>


At least his posts are useful, contrary to yours!

 
Reply With Quote
 
 
 
 
Kenny McCormack
Guest
Posts: n/a
 
      08-02-2012
In article <(E-Mail Removed)> ,
Cal Dershowitz <(E-Mail Removed)> wrote:
....
>So you've got the proprietary yet available header as the only thing in
>the source that is non-standard. Eric's a little bit of a zealot about
>that, but he's totally right that your answer is over in
>comp.unix.programmer .


As I said before, every other newsgroup and online forum (IME) has a simple
ethic of "If you can't (or won't) answer the question, then STFU!". If you
violate this norm, you are pretty much politely ignored. But (obviously),
here in CLC, no such norm exists (hence this post [the post I am writing
right now] is unassailably correct in context).

But the real, underlying, problem is that the current rulers of CLC have
usurped the name. That is, a newsgroup named comp.lang.c should be about C,
but they have changed it into comp.religion.c - but forgot to change the
name. It is as if someone (back around 1991) had been assigned the task of
filing the paperwork to setup (charter, whatever terminology you prefer) a
new newsgroup, but forgot to do so (maybe they went on vacation that week,
maybe they got sick - who can say?). So, in desperation, they (the
religious zealots) just setup shop (for their new idea of what a newsgroup
about C should be like) here in comp.lang.c.

--
(This discussion group is about C, ...)

Wrong. It is only OCCASIONALLY a discussion group
about C; mostly, like most "discussion" groups, it is
off-topic Rorsharch [sic] revelations of the childhood
traumas of the participants...

 
Reply With Quote
 
 
 
 
tom st denis
Guest
Posts: n/a
 
      08-02-2012
On Jul 31, 6:24*pm, jacob navia <(E-Mail Removed)> wrote:
> Le 31/07/12 23:55, tom st denis a crit :
>
> > On Jul 29, 1:10 pm, (E-Mail Removed) (Kenny McCormack)
> > wrote:

>
> >> Off topic. *Not portable. *Cant discuss it here. *Blah, blah, blah.

>
> > I like that you post. *In case of a lull of NNTP activity you're
> > useful to check if I still have net access...

>
> At least his posts are useful, contrary to yours!


Given that you've hijacked CLC to talk about your super-duper
collections library [which has nothing to do with clc] I'll take that
for what it's worth. Nothing.

Tom
 
Reply With Quote
 
tom st denis
Guest
Posts: n/a
 
      08-02-2012
On Aug 2, 8:20*am, (E-Mail Removed) (Kenny McCormack) wrote:
> But the real, underlying, problem is that the current rulers of CLC have
> usurped the name. *That is, a newsgroup named comp.lang.c should be about C,
> but they have changed it into comp.religion.c - but forgot to change the
> name. *It is as if someone (back around 1991) had been assigned the task of
> filing the paperwork to setup (charter, whatever terminology you prefer) a
> new newsgroup, but forgot to do so (maybe they went on vacation that week,
> maybe they got sick - who can say?). *So, in desperation, they (the
> religious zealots) just setup shop (for their new idea of what a newsgroup
> about C should be like) here in comp.lang.c.


Why is it such a hard concept that clc is about the C language and
comp.unix.programmer is about programming applications in unix?

If you want to chat about the finer points of POSIX functionality/etc
then move on over to comp.unix.programmer.

In the real world this would be like you showing up at a football game
and complaining that there are no hockey fans around.

Tom
 
Reply With Quote
 
tom st denis
Guest
Posts: n/a
 
      08-02-2012
On Jul 30, 7:26*am, jacob navia <(E-Mail Removed)> wrote:
> Le 30/07/12 13:13, Nobody a écrit :
>
> > On Sun, 29 Jul 2012 11:57:32 -0500, Stephen Sprunk wrote:

>
> >> If you've already decided to limit portability to POSIX systems, pipes
> >> are the general solution for what you're trying to do, but may not be
> >> the optimal solution. *For instance, in the case of "ls", why not just
> >> call the functions in <dirent.h> yourself rather than opening a pipe to
> >> a program that calls them for you and then writing an enormous amount of
> >> code to parse its output to extract the same data?

>
> > Because that requires learning the API, whereas someone who already knows
> > about system() and popen() can just write half-baked code and avoid the
> > effort of learning to do it correctly.

>
> Why is that not correct?


In theory "remove()" is more portable given that "rm" is a typical
*NIX command not found on [say] Windows.

> Why bothering to learn the API, and spend hours debugging a new
> version of "ls"?


Depends on what you want to do with the information and how you want
to present it. When I hit "read file" in nano it presents me with a
directory listing that is nicely formatted that I can walk through
with the arrow keys. Can't do that with "ls" ...

> If performance is not a big concern the code below will work correctly
> even if in this case a call to remove() would be shorter.
>
> > I have seen real-world code which did:

>
> > * *char buf[100];
> > * *sprintf(buf, "rm %s", filename);
> > * *system(buf);

>
> Yes, the hard coded buffer size is a problem but in principle
> this thing will work as intended.


Except where the system doesn't have an "rm" command... And this code
snippet [though just an example] doesn't check the return code of
system. This code can also fail simply because it cannot start a
shell to run "rm" whereas remove() will fail for reasons more directly
related to failing to remove the damn file/directory.

Tom
 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      08-02-2012
On Mon, 2012-07-30, James Kuyper wrote:
> On 07/30/2012 10:54 AM, Jorgen Grahn wrote:
>> On Sun, 2012-07-29, Rui Maciel wrote:
>>> China Blue [Tor], Meersburg wrote:

> ...
>>>> Are you happy you're wasting more electrons being a dick
>>>> than where spent just giving a straightfotward and useful answer?
>>>
>>> If you took the time to actually read what has been repeatedly pointed out
>>> to you, you would notice that the replies you've got were actually straight
>>> forwrad and useful.

> ...
>> I do think the first "this is offtopic, try c.u.p." post could have
>> been formulated better.

>
> How?
>
> It had two main parts. The first part pointed out to the OP the clues
> that he should have used to realize that some other forum would be a
> more appropriate one for his question. The second part identified c.u.p
> as that more appropriate forum. Would you have left out the first part?
> It seems to me that it's important for people to understand how easy it
> is to determine that c.u.p is a more appropriate forum than this one for
> questions like this one.


We're talking about
Message-ID: <jv3k82$92v$(E-Mail Removed)>

You're right. The first part /did/ come across as rather aggressive
when I read it ... but it wasn't insulting, and that's better than the
average Usenet posting.

I think the tone of the postings that followed influenced my view of
the first one.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
Kenny McCormack
Guest
Posts: n/a
 
      08-02-2012
In article <(E-Mail Removed)>,
tom st denis <(E-Mail Removed)> wrote:
....
>In the real world this would be like you showing up at a football game
>and complaining that there are no hockey fans around.


Wrong, as usual.

A closer analogy would be as if I showed up at a football game and was told
that I (and all the other hockey fans) had to go home, because we aren't
true, blue, football fans (because we happen to be fans of both sports).

--
"We should always be disposed to believe that which appears to us to be
white is really black, if the hierarchy of the church so decides."

- Saint Ignatius Loyola (1491-1556) Founder of the Jesuit Order -

 
Reply With Quote
 
tom st denis
Guest
Posts: n/a
 
      08-02-2012
On Aug 2, 10:16*am, (E-Mail Removed) (Kenny McCormack)
wrote:
> In article <(E-Mail Removed)..com>,
> tom st denis *<(E-Mail Removed)> wrote:
> ...
>
> >In the real world this would be like you showing up at a football game
> >and complaining that there are no hockey fans around.

>
> Wrong, as usual.
>
> A closer analogy would be as if I showed up at a football game and was told
> that I (and all the other hockey fans) had to go home, because we aren't
> true, blue, football fans (because we happen to be fans of both sports).


Nobody is questioning your devotion to the C language. They're
questioning if you know the name on the door you walked through.

There is actually an entire usenet group devoted to programming
challenges with *NIX and it's not clc.

That's the thing I don't get about you. It's not like there is NO
PLACE for those sorts of questions you just choose to refuse to accept
the reality that you're in the wrong spot and then you post [regularly
I might add] over the course of YEARS about the great travesty that is
topicality.

And it's not even like the other [helpful] regulars are being
particularly rude or unhelpful they're just telling the posters that
there are better places to ask the questions which will likely get
more appropriate responses.

Tom
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      08-02-2012
tom st denis <(E-Mail Removed)> writes:
> On Aug 2, 10:16Â*am, (E-Mail Removed) (Kenny McCormack)
> wrote:

[snip]
> Nobody is questioning your devotion to the C language. They're
> questioning if you know the name on the door you walked through.


Please don't feed the troll.

--
Keith Thompson (The_Other_Keith) http://www.velocityreviews.com/forums/(E-Mail Removed) <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
tom st denis
Guest
Posts: n/a
 
      08-03-2012
On Aug 2, 6:03*pm, Keith Thompson <(E-Mail Removed)> wrote:
> tom st denis <(E-Mail Removed)> writes:
>
> > On Aug 2, 10:16*am, (E-Mail Removed) (Kenny McCormack)
> > wrote:

> [snip]
> > Nobody is questioning your devotion to the C language. *They're
> > questioning if you know the name on the door you walked through.

>
> Please don't feed the troll.


Never hurts to check in once in a while and see if there is any
humanity behind the account.

Tom
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
enhancing/wrapping an existing instance of a duck Neville Dempsey Python 1 09-01-2008 06:27 PM
Adding a timeout to commands by wrapping + thread - suggestions? dduck Java 11 09-04-2007 12:34 PM
wrapping existing instance in new interface insyte@gmail.com Python 1 11-15-2006 11:25 PM
Need Help Differentiating Bad Commands From Incomplete Commands Tim Stanka Python 1 08-02-2004 02:08 AM
Re: man pages for C commands (GCC commands) Ben Pfaff C Programming 4 06-28-2003 06:21 PM



Advertisments