delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/20/15:30:31

From: "JCx" <jicehix AT worldnet DOT fr>
Newsgroups: comp.os.msdos.djgpp
Subject: Problem writing in a file...
Date: Wed, 20 May 1998 20:16:21 +0200
Lines: 49
Message-ID: <6jv6lo$73e$1@news3.isdnet.net>
NNTP-Posting-Host: p15-199.province.worldnet.fr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

   Hi there !

I just spent two hours trying to code -without success- the following thing:
I open a text file, then look for a specific string in this file (with
fgets) and then, when I find this string, my program is supposed to add
another string just after the one it found (with fprintf). The problem is:
the program duplicates everything that stands after the line found, and then
adds the line I looked for+the line I wanted to add at the end of the file !

   To say it clearly:

It opens system.ini : working
It looks for [drivers32] : working
I *should* write a string just after this line : bug

   Could anyone help me ?
   Source included.

   Thanks, JCx.
   jicehix AT worldnet DOT fr


begin 666 addv.c
M+RH AT 861D=BYC("HO#0H-"B-I;F-L=61E(#QS=&1I;RYH/@T*(VEN8VQU9&4@
M/'-T9&QI8BYH/@T*#0I&24Q%("IF:6-H:65R.PT*8VAA<B!T97AT95LX,%T[
M#0II;G0 AT 9FEL94]+.PT*#0IV;VED(&UA:6XH=F]I9"D-"GL-"B @(&9I;&5/
M2STP.PT*(" @<')I;G1F*")<;D]P96YI;F<@9FEL92XB*3L-"B @(&9I8VAI
M97(]9F]P96XH(G1E<W0N:6YI(BPB<BLB*3L-"B @(&EF("AF:6-H:65R/3U.
M54Q,*0T*(" @>PT*(" @(" @<')I;G1F*")<;D9I;&4@;F]T(&9O=6YD(#HH
M7&XB*3L-"B @(" @(&5X:70H,2D[#0H@("!]#0H@("!P<FEN=&8H(EQN1FEL
M92!O<&5N960N(BD[#0H@("!W:&EL92 H(69I;&5/2RD-"B @('L-"B @(" @
M(&9G971S*'1E>'1E+#$R+&9I8VAI97(I.PT*(" @(" @:68@*'1E>'1E6S!=
M/3TG6R<I#0H@(" @(" @:68@*'1E>'1E6S%=/3TG9"<I#0H@(" @(" @(&EF
M("AT97AT95LR73T])W(G*0T*(" @(" @(" @:68@*'1E>'1E6S-=/3TG:2<I
M#0H@(" @(" @(" @:68@*'1E>'1E6S1=/3TG=B<I#0H@(" @(" @(" @(&EF
M("AT97AT95LU73T])V4G*0T*(" @(" @(" @(" @:68@*'1E>'1E6S9=/3TG
M<B<I#0H@(" @(" @(" @(" @:68@*'1E>'1E6S==/3TG<R<I#0H@(" @(" @
M(" @(" @(&EF("AT97AT95LX73T])S,G*0T*(" @(" @(" @(" @(" @:68@
M*'1E>'1E6SE=/3TG,B<I#0H@(" @(" @(" @(" @(" @:68@*'1E>'1E6S$P
M73TG72<I#0H@(" @(" @(" @(" @(" @>PT*(" @(" @(" @(" @(" @(" @
M(&9P<FEN=&8H9FEC:&EE<BPB7&Y4:&ES(&ES(&$@=&5S=%QN(BD[#0H@(" @
M(" @(" @(" @(" @(" @<')I;G1F*")<;E-T<FEN9R!A9&1E9"XB*3L-"B @
M(" @(" @(" @(" @(" @("!F8VQO<V4H9FEC:&EE<BD[#0H@(" @(" @(" @
M(" @(" @(" @<')I;G1F*")<;D9I;&4 AT 8VQO<V5D+EQN(BD[#0H@(" @(" @
M(" @(" @(" @(" @9FEL94]+/3$[#0H@(" @(" @(" @(" @(" @?0T*(" @
&?0T*?0T*
`
end

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019