Am verificat si cu hexdump adaugand la sfarsit spatiu rezultatul e la fel (deci fail nu e de la spatiu):<br><br><pre>file name: test8.out<br>mime type: <br><br>0000-0010: 0d 0a 6e 6f-72 72 69 73-20 6a 61 63-71 75 69 20 ..norris .jacqui.<br>
0000-0020: 6f 6c 69 79-20 64 65 65-6e 61 20 6e-6f 72 6d 61 oliy.dee na.norma<br>0000-0030: 20 65 72 69-6e 6e 61 20-64 6f 72 6f-6c 69 73 61 .erinna. dorolisa<br>0000-0040: 20 65 6d 6d-79 65 20 70-68 69 6c 6f-6d 65 6e 61 .emmye.p hilomena<br>
0000-0050: 20 64 6f 72-65 6e 65 20-63 61 74 65-20 6e 65 76 .dorene. cate.nev<br>0000-0060: 73 61 20 6a-65 6e 6e 65-74 74 65 20-63 61 72 6f sa.jenne tte.caro<br>0000-0070: 6c 79 6e 65-20 73 75 6e-6e 79 20 65-76 61 6e 6e lyne.sun ny.evann<br>
0000-0080: 65 20 62 6f-6e 69 74 61-20 61 72 64-69 73 6a 20 e.bonita .ardisj.<br>0000-0090: 64 65 61 6e-65 20 74 69-70 68 61 6e-79 20 65 62 deane.ti phany.eb<br>0000-00a0: 6f 6e 79 20-6b 61 72 6c-65 6e 20 6d-61 6e 66 72 ony.karl en.manfr<br>
0000-00b0: 65 64 20 62-65 69 6c 75-6c 20 0d 0a-61 73 68 6c ed.beilu l...ashl<br>0000-00c0: 65 79 20 6d-69 72 65 6c-6c 61 20 6d-61 6c 79 6e ey.mirel la.malyn<br>0000-00d0: 64 61 20 61-64 72 69 65-6e 6e 65 20-6c 61 74 69 da.adrie nne.lati<br>
0000-00e0: 73 68 61 20-63 61 63 69-6c 69 61 20-6d 61 72 69 sha.caci lia.mari<br>0000-00f0: 61 6e 6e 20-66 72 69 65-64 6d 61 6e-20 68 69 6c ann.frie dman.hil<br>0000-0100: 64 65 20 63-65 63 65 6c-69 61 20 6a-61 63 71 75 de.cecel ia.jacqu<br>
0000-0110: 65 74 74 65-20 6d 65 61-72 61 20 6b-61 74 68 72 ette.mea ra.kathr<br>0000-0120: 79 6e 65 20-61 6c 74 75-72 69 6e 67-20 6f 74 68 yne.altu ring.oth<br>0000-0130: 65 6c 69 61-20 61 6c 65-78 69 6e 65-20 63 6f 72 elia.ale xine.cor<br>
0000-0140: 64 65 79 20-66 72 61 6e-63 65 73 63-61 20 63 68 dey.fran cesca.ch<br>0000-0150: 61 72 6c 69-6e 65 20 6e-69 63 6f 6c-6c 65 20 63 arline.n icolle.c<br>0000-015a: 61 72 6f 6c-79 6e 6e 20-0d 0a arolynn. ..<br>
</pre><br><pre>file name: out1.txt<br>mime type: <br><br>0000-0010: 0d 0a 6e 6f-72 72 69 73-20 6a 61 63-71 75 69 20 ..norris .jacqui.<br>0000-0020: 6f 6c 69 79-20 64 65 65-6e 61 20 6e-6f 72 6d 61 oliy.dee na.norma<br>
0000-0030: 20 65 72 69-6e 6e 61 20-64 6f 72 6f-6c 69 73 61 .erinna. dorolisa<br>0000-0040: 20 65 6d 6d-79 65 20 70-68 69 6c 6f-6d 65 6e 61 .emmye.p hilomena<br>0000-0050: 20 64 6f 72-65 6e 65 20-63 61 74 65-20 6e 65 76 .dorene. cate.nev<br>
0000-0060: 73 61 20 6a-65 6e 6e 65-74 74 65 20-63 61 72 6f sa.jenne tte.caro<br>0000-0070: 6c 79 6e 65-20 73 75 6e-6e 79 20 65-76 61 6e 6e lyne.sun ny.evann<br>0000-0080: 65 20 62 6f-6e 69 74 61-20 61 72 64-69 73 6a 20 e.bonita .ardisj.<br>
0000-0090: 64 65 61 6e-65 20 74 69-70 68 61 6e-79 20 65 62 deane.ti phany.eb<br>0000-00a0: 6f 6e 79 20-6b 61 72 6c-65 6e 20 6d-61 6e 66 72 ony.karl en.manfr<br>0000-00b0: 65 64 20 62-65 69 6c 75-6c 20 0d 0a-61 73 68 6c ed.beilu l...ashl<br>
0000-00c0: 65 79 20 6d-69 72 65 6c-6c 61 20 6d-61 6c 79 6e ey.mirel la.malyn<br>0000-00d0: 64 61 20 61-64 72 69 65-6e 6e 65 20-6c 61 74 69 da.adrie nne.lati<br>0000-00e0: 73 68 61 20-63 61 63 69-6c 69 61 20-6d 61 72 69 sha.caci lia.mari<br>
0000-00f0: 61 6e 6e 20-66 72 69 65-64 6d 61 6e-20 68 69 6c ann.frie dman.hil<br>0000-0100: 64 65 20 63-65 63 65 6c-69 61 20 6a-61 63 71 75 de.cecel ia.jacqu<br>0000-0110: 65 74 74 65-20 6d 65 61-72 61 20 6b-61 74 68 72 ette.mea ra.kathr<br>
0000-0120: 79 6e 65 20-61 6c 74 75-72 69 6e 67-20 6f 74 68 yne.altu ring.oth<br>0000-0130: 65 6c 69 61-20 61 6c 65-78 69 6e 65-20 63 6f 72 elia.ale xine.cor<br>0000-0140: 64 65 79 20-66 72 61 6e-63 65 73 63-61 20 63 68 dey.fran cesca.ch<br>
0000-0150: 61 72 6c 69-6e 65 20 6e-69 63 6f 6c-6c 65 20 63 arline.n icolle.c<br>0000-015a: 61 72 6f 6c-79 6e 6e 20-0d 0a arolynn. ..<br></pre><br>Nu este absolut nicio diferenta intre ele... <br><br>
In plus am scris si un program la server ce imi ia caracter cu caracter si imi afiseaza byte-ul diferit ... si nu afiseaza absolut nimic diferit intre cele doua fisiere (ar fi trebuit sa afiseze caracterele diferite si pozitia).<br>
<br>FILE *f1,*f2;<br><br>f1 = fopen("_test8.tmp","r");<br>if (f1!=NULL)<br>{<br> char buffer[1024];<br> while (fgets(buffer,1024,f1)!=NULL)<br> printf("%s",buffer);<br><br> f1 = fopen("_test8.tmp","r");<br>
f2 = fopen("test8.out","r");<br> char c1,c2;<br> unsigned int poz = 0;<br> do<br> {<br> c1 =fgetc(f1);<br> c2 =fgetc(f2);<br> poz++;<br> if (c1!=c2) printf("%c %c %i\n",c1,c2,poz); //eroare<br>
}<br> while(c1!=EOF&&c2!=EOF);<br> if (c1!=EOF||c2!=EOF) printf("caractere in minus\n");<br> else printf("totul ok");<br>}<br><br><br>I'm stuck...<br><br><br><br><br><br><div class="gmail_quote">
2009/4/15 calin badea <span dir="ltr"><<a href="mailto:bottomofsky@gmail.com">bottomofsky@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Salut,<br><br>Am adaugat cate un printf("\r\n"), insa testul tot pica si cred ca e de la spatiile de la finalul randurilor.<br><br><div class="gmail_quote">2009/4/15 Daniel Flamaropol <span dir="ltr"><<a href="mailto:raptorclw@gmail.com" target="_blank">raptorclw@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5"><br>Salut,<br><br>Si eu am avut aceeasi problema ca tine (mi-a luat ceva sa imi dau seama ca optiunile de ignorare a randurilor lipsa in diff nu se aplica asupra <b>primului</b> rand). Solutia a fost simplua : adaugi un endl ( ca sa fie portabil ) chiar la inceputul afisarii oricarei linii din tabel. Problem solved. Toate celelalte teste trec cu brio, deci nu afecteaza in niciun fel desfasurarea normala a testarii.<br>
<br><br>Numai bine,<br>Daniel Flamaropol.<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
la celelalte teste nu vad sa fie "\r\n" la inceputul printarii, iar la<br>
sfarsitul liniei sa fie " " .<br>
<br>
este o greseala cu acest test (numarul 8)?<br>
<br></blockquote></div>
<br></div></div>_______________________________________________<br>
so mailing list<br>
<a href="mailto:so@cursuri.cs.pub.ro" target="_blank">so@cursuri.cs.pub.ro</a><br>
<a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br>
<br></blockquote></div><br>
</blockquote></div><br>