<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Thanks for your reply. I have used getopt() and I have implemented it this way. My observation is that the standard ls command in Unix does not work in this way. I have checked it in Linux Lab. So my question was "why", not "how".</div><div><br></div><div>-Sadia</div><div><br></div><br><div><div>On Oct 6, 2014, at 3:58 PM, Pengfei Zhang &lt;<a href="mailto:pzhang11@stevens.edu">pzhang11@stevens.edu</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">I implement this by using getopt, it would get options as the order you input. So I just set when I get -1, set nflag and lflag to 0, vice verse. The last one in the argument list would be set to 1, other 2 options would be set to 0.<div>Hope that helps.</div><div><br></div><div>Pengfei Zhang</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 6, 2014 at 3:41 PM, Sadia Akhter <span dir="ltr">&lt;<a href="mailto:sakhter@stevens.edu" target="_blank">sakhter@stevens.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>In the assignment, it says, "<span style="font-size:10pt;font-family:Times">The </span><span style="font-size:10pt;font-family:Courier;font-weight:700">−1</span><span style="font-size:10pt;font-family:Times">, </span><span style="font-size:10pt;font-family:Courier;font-weight:700">−l</span><span style="font-size:10pt;font-family:Times">, and </span><span style="font-size:10pt;font-family:Courier;font-weight:700">−n </span><span style="font-size:10pt;font-family:Times">options override each other; the last one specified determines the format used." &nbsp;I have implemented it this way. But when I was testing it by comparing with the ls command in Unix</span>, I found that -n overrides -l, -1; and -l overrides only -1. So the standard behavior is different from that what was given in the midterm specification.&nbsp;</div><div><br></div><div>Is the deviation from the standard intentional? So which one should we implement?&nbsp;</div><div><br></div><div>Thanks,</div><div>Sadia</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>
                
        
        
                <div title="Page 2">
                        <div>
                                <div><p><br></p>
                                </div>
                        </div>
                </div></div></div><br>_______________________________________________<br>
cs631apue mailing list<br>
<a href="mailto:cs631apue@lists.stevens.edu">cs631apue@lists.stevens.edu</a><br>
<a href="https://lists.stevens.edu/mailman/listinfo/cs631apue" target="_blank">https://lists.stevens.edu/mailman/listinfo/cs631apue</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Best regards</div><div>Pengfei Zhang</div><div>---------------------------------------------------------------------------</div><span>&lt;未标题-1.jpg&gt;</span><br></div>
</div>
</blockquote></div><br></body></html>