<div dir="ltr"><div dir="ltr"><div>Într-adevăr, se pare că fișierul nu e creat cu permisiunile corecte:</div><div><br></div><div>Access (0000/----------)</div><div><br></div><div>Uite cum ar trebuie să arate la un fișier obișnuit:</div><div><br></div><div>Access: (0644/-rw-r--r--)</div><div><br></div><div>Ca să recapitulez: pentru modurile "w" și "w+" fișierul trebuie creat dacă nu există. Dacă există, trebuie trunchiat la dimensiune 0.<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 20 Mar 2019 at 13:54, Paul Olaru via so <<a href="mailto:so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Poza îmi sugerează că fișierul lipsă nu a fost creat de fopen (sau a fost șters for some reason). Sper că nu folosești O_TMPFILE sau alte BS-uri. Cum faci la open() sau creat() să se creeze fișierul dacă nu există deja? Also, ai grijă ce faci cu permisiunile (am văzut la laborator că unii creau din greșeală cu permisiunile 0000...nice)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 20, 2019, 13:51 Paul Olaru <<a href="mailto:olarupaulstelian97@gmail.com" target="_blank">olarupaulstelian97@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Unul din teste verifică ce se întâmplă când deschizi un fișier preexistent de lungime diferită de 0 cu modul "w" sau "w+". În ambele cazuri, fișierul trebuie să fie redus la dimensiunea 0.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 20, 2019, 13:50 Aida-Ștefania MANOLE (87667) via so <<a href="mailto:so@cursuri.cs.pub.ro" rel="noreferrer" target="_blank">so@cursuri.cs.pub.ro</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0px;margin-bottom:0px">Buna,</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">Am o problema la primul test, cel cu fopen. Se creeaza un fisier care nu exista inainte, se inchide fara erori, insa cand este apelata in main file_size aparent caulculeaza o dimensiune diferita de 0. Am dezactivat optiunea
de cleanup pentru a vedea fisierul de referinta si acesta are dimesiunea 0 (am rulat stat pe el). Cum as putea sa rezolv aceasta problema? Nu-mi dau seama exact de unde vine. Am atasat si 2 imagini cu output-ul comenzii stat si rezultatul testului 1.</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">Multumesc,</p>
<p style="margin-top:0px;margin-bottom:0px">Manole Aida Stefania</p>
<p style="margin-top:0px;margin-bottom:0px"><span style="font-size:12pt">Git repo: <a href="https://gitlab.cs.pub.ro/aida.manole/l3-so-assignments/tree/master/2-stdio" class="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527OWAAutoLink" id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPlnk113823" rel="noreferrer noreferrer" target="_blank">https://gitlab.cs.pub.ro/aida.manole/l3-so-assignments/tree/master/2-stdio</a></span></p>
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPBorder_GT_15529942183760.9133433917631315" style="margin-bottom:20px;overflow:auto;width:100%;text-indent:0px">
<table id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPContainer_15529942183700.8658691191307484" style="width:90%;background-color:rgb(255,255,255);overflow:auto;padding-top:20px;padding-bottom:20px;margin-top:20px;border-top:1px dotted rgb(200,200,200);border-bottom:1px dotted rgb(200,200,200)" cellspacing="0">
<tbody>
<tr style="border-spacing:0px" valign="top">
<td id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527ImageCell_15529942183720.5752061228295944" colspan="1" style="width:250px;display:table-cell;padding-right:20px">
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPImageContainer_15529942183720.42096296176122916" style="background-color:rgb(255,255,255);height:128px;margin:auto;display:table;width:128px">
<a id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPImageAnchor_15529942183720.481925800566793" href="https://gitlab.cs.pub.ro/aida.manole/l3-so-assignments/tree/master/2-stdio" style="display:table-cell;text-align:center" rel="noreferrer noreferrer" target="_blank"><img id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPThumbnailImageID_15529942183720.6764095254994673" style="display: inline-block; max-width: 250px; max-height: 250px; height: 128px; width: 128px; border-width: 0px; vertical-align: bottom;" src="https://gitlab.cs.pub.ro/assets/gitlab_logo-7ae504fe4f68fdebb3c2034e36621930cd36ea87924c11ff65dbcb8ed50dca58.png" width="128" height="128"></a></div>
</td>
<td id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527TextCell_15529942183730.10803129384231713" colspan="2" style="vertical-align:top;padding:0px;display:table-cell">
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPRemovePreviewContainer_15529942183730.1848749832779517"></div>
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPTitle_15529942183730.95597086920694" style="color:rgb(0,120,215);font-weight:400;font-size:21px;font-family:wf_segoe-ui_light,"Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;line-height:21px">
<a id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPUrlAnchor_15529942183740.04204508841774346" href="https://gitlab.cs.pub.ro/aida.manole/l3-so-assignments/tree/master/2-stdio" style="text-decoration:none" rel="noreferrer noreferrer" target="_blank">Sign in</a></div>
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPMetadata_15529942183740.24595282450450595" style="margin:10px 0px 16px;color:rgb(102,102,102);font-weight:400;font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:14px;line-height:14px">
<a href="http://gitlab.cs.pub.ro" rel="noreferrer noreferrer" target="_blank">gitlab.cs.pub.ro</a></div>
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPDescription_15529942183750.8741882817138222" style="display:block;color:rgb(102,102,102);font-weight:400;font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:14px;line-height:20px;max-height:100px;overflow:hidden">
GitLab Community Edition</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<p></p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px"><a href="https://imgur.com/a/tZLzqA8" class="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527OWAAutoLink" id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPlnk159815" rel="noreferrer noreferrer" target="_blank">https://imgur.com/a/tZLzqA8</a><br>
</p>
<p style="margin-top:0px;margin-bottom:0px"><a href="https://imgur.com/a/oxyIjiJ" class="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527OWAAutoLink" id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPlnk983532" rel="noreferrer noreferrer" target="_blank">https://imgur.com/a/oxyIjiJ</a></p>
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPBorder_GT_15529941017320.5057640315886867" style="margin-bottom:20px;overflow:auto;width:100%;text-indent:0px">
<table id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPContainer_15529941017170.32418565547011036" style="width:90%;background-color:rgb(255,255,255);overflow:auto;padding-top:20px;padding-bottom:20px;margin-top:20px;border-top:1px dotted rgb(200,200,200);border-bottom:1px dotted rgb(200,200,200)" cellspacing="0">
<tbody>
<tr style="border-spacing:0px" valign="top">
<td id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527ImageCell_15529941017210.28505706496666927" colspan="1" style="width:250px;display:table-cell;padding-right:20px">
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPImageContainer_15529941017210.3766148327698049" style="background-color:rgb(255,255,255);height:131px;margin:auto;display:table;width:250px">
<a id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPImageAnchor_15529941017230.9270055132406465" href="https://imgur.com/a/oxyIjiJ" style="display:table-cell;text-align:center" rel="noreferrer noreferrer" target="_blank"><img id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPThumbnailImageID_15529941017230.6416984996711954" style="display: inline-block; max-width: 250px; max-height: 250px; height: 131px; width: 250px; border-width: 0px; vertical-align: bottom;" src="https://i.imgur.com/Ui9xgS3.jpg?fb" width="250" height="131"></a></div>
</td>
<td id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527TextCell_15529941017250.5207053656349585" colspan="2" style="vertical-align:top;padding:0px;display:table-cell">
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPRemovePreviewContainer_15529941017250.1066392422541178"></div>
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPTitle_15529941017250.4059189655641178" style="color:rgb(0,120,215);font-weight:400;font-size:21px;font-family:wf_segoe-ui_light,"Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;line-height:21px">
<a id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPUrlAnchor_15529941017280.9742049044334578" href="https://imgur.com/a/oxyIjiJ" style="text-decoration:none" rel="noreferrer noreferrer" target="_blank">Imgur</a></div>
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPMetadata_15529941017280.1561400515121829" style="margin:10px 0px 16px;color:rgb(102,102,102);font-weight:400;font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:14px;line-height:14px">
<a href="http://imgur.com" rel="noreferrer noreferrer" target="_blank">imgur.com</a></div>
<div id="gmail-m_5050723349019608270m_-383396640888036389m_-3608207308238173527LPDescription_15529941017300.8583689381855515" style="display:block;color:rgb(102,102,102);font-weight:400;font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:14px;line-height:20px;max-height:100px;overflow:hidden">
Post with 0 views.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
<p></p>
</div>
</div>
_______________________________________________<br>
<a href="http://ocw.cs.pub.ro/courses/so/info/lista-discutii" rel="noreferrer noreferrer noreferrer" target="_blank">http://ocw.cs.pub.ro/courses/so/info/lista-discutii</a></blockquote></div>
</blockquote></div>
_______________________________________________<br>
<a href="http://ocw.cs.pub.ro/courses/so/info/lista-discutii" rel="noreferrer" target="_blank">http://ocw.cs.pub.ro/courses/so/info/lista-discutii</a></blockquote></div>