Re: Redirection issue




Ed Prochak wrote:
souissipro wrote:
Ed Prochak wrote:
[snip]

My question is did you follow ANY of the suggestions I gave you? Your
error is very simple. I did look at your code and found the problem
right away. I really am trying to help you learn. This problem is
independent of the programming language. So please, review your own
code. before you scroll down to what I see as the root problem.

[snip]

You never called the new function!

BTW, long term your approach is going about it the hard way, but you'll
learn more this way.
Ed

Hi Ed,

Thank you anyway for your comments. I appreciate them very much.
I decommented the code in the new function redir_cmd, changed the types
of fd1 and fd2 to char and the redirection works fine now. However, the
simple command and the simple input file are now not working.
Please any precise idea because I have to finish this shell for
tomorrow.

Thanks,
souissipro

based on your reply, I take it that
you did NOT follow any of my suggestions. (I could be wrong. 8^)
your source listing from the first post is not the version of code you
are currrently discussing since my comment was about the main() routine
and nothing was commented out in that version. I haven't seen you post
another version.

Finally, NEVER expect responses in a newsgroup in less than 24 hours.
Some people will not even have seen your request before a full day has
past. Just remember, newsgroups are not like AOL Chat rooms.

Good luck, you will need it.
Ed

ED,

OK!
to reply your answer. The new function is called in the main here:
if (argc == 3) {
f = fopen(argv[1], "r");
if (f == NULL) {
fprintf(stderr, "impossible d'ouvrir le fichier en lecture\n");
exit(EXIT_FAILURE);
}
/* fgets fait une lecture ligne par ligne, et stocke */
/* la ligne lue (y compris le \n) dans buf */
/* il faut que la ligne fasse moins de 255 caracteres */
/* sinon seuls les 255 premiers caracteres sont lus */

while (fgets(buf, 255, f) != NULL) {
// call of the new function via parse_line function
parse_line(buf,argv[1],argv[2]);
printf("%s",buf);
}
isn't right?

.



Relevant Pages

  • Re: Redirection issue
    ... souissipro wrote: ... of fd1 and fd2 to char and the redirection works fine now. ... your source listing from the first post is not the version of code you ... NEVER expect responses in a newsgroup in less than 24 hours. ...
    (comp.lang.c)
  • Re: Handling Access events in .net
    ... In your first post on this topic you wrote: ... able to trigger VB code from within Access means that I can transition the ... Cindy Meister ... This reply is posted in the Newsgroup; please post any follow question or reply ...
    (microsoft.public.office.developer.automation)
  • Re: Merry Christmas
    ... It is my first post in the Newsgroup and wanted to take advantage of to ... desire to everyone a Merry Christmas (Christmas finishes in January 6, ... Before the Midnight Mass: ... Soon I will be doing some consultations about photography in the Newsgroup. ...
    (rec.photo.digital)
  • To ALL: How to respond to WATERCOOLED posts
    ... I don't mean to be rude, but something has to be done about the recent watercooled post flood. ... This newsgroup is STRICTLY for AIRCOOLED discussion only, for watercooled Volkswagens there is another, WATERCOOLED newsgroup. ... (If they bothered to really read and study the group for a while, before making their first post, which is what they should have done in the first place, they would have noticed that watercooled discussion is not wanted here... ... Do not reply with a tech answer in here, redirect the discussion and write your reply in the watercooled group, so the search engines could return valid results and we can be left alone with our aircooled content. ...
    (rec.autos.makers.vw.aircooled)
  • Re: Option Compare Statement
    ... Your first post regarding this in the vb.controls newsgroup was, ... In VB 6.0, I have two variant arrays, that may either contain doubles or ... Do, I have to check the data type for all members, if they are ...
    (microsoft.public.vb.general.discussion)