<div dir="ltr">Hi guys,<div><br></div><div>I am experimenting with the dup2. I have attached my code. </div><div><br></div><div>I am trying the dup the stdout to a file. But, the output is not as expected. </div><div><br></div><div>I am not getting the output redirected to the file. Instead it&#39;s just printing on the screen. </div><div><br></div><div>I assume the STDOUT_FILENO is a constant, which explains the behaviour of the code. But, can someone tell me, what changes should be done to get the output redirected to the file.</div><div> <br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><font color="#134f5c">Thank you.</font><div><font color="#134f5c"><br></font></div><div><font color="#134f5c">Kind regards,</font></div><div><font color="#134f5c">Jeeva</font></div><div><font color="#0c343d"><br></font></div><div><br></div></div></div></div>
</div></div>