<div dir="ltr"><div>Evening Marlon,<br><br>The strange output you&#39;ve encountered is the result of strcmp(3) performing a<br>case-sensitive comparison. Since uppercase characters appear first in the ASCII<br>table, they will appear first in your output. [0]<br><br>To my knowledge, C does not come shipped with a case-insensitive comparison<br>function; as a result, you&#39;ll have to implement your own using tolower(3) or a<br>similar tool. From this lowercase string (or uppercase- it doesn&#39;t matter as<br>long as it&#39;s consistent), strcmp(3) will be able to compare the filenames<br>properly.<br><br>[0] <a href="https://en.wikipedia.org/wiki/ASCII">https://en.wikipedia.org/wiki/ASCII</a><br><br></div>- Pat<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 21, 2016 at 11:31 PM, mseaton <span dir="ltr">&lt;<a href="mailto:mseaton@stevens.edu" target="_blank">mseaton@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">Hello,<br>
the standard ls sorts files stored in directories. My files that contains a . seems to &quot;throw off&quot; the sorting a bit. for example:<br>
<br>
Here are a list of files from my /home/mseaton directory:<br>
<br>
Desktop<br>
Documents<br>
Downloads<br>
Music<br>
NewFolder<br>
Pictures<br>
PrintBlocks.c<br>
Public<br>
SortFileSize.c<br>
Templates<br>
Videos<br>
examples.desktop<br>
file1<br>
functions.h<br>
headers.h<br>
ls<br>
ls.c<br>
ls.c~<br>
mozilla.pdf<br>
<br>
As you can see, examples.desktop and a few others are out of place. Any suggestion for how to handle the files with the .? I was planning on removing the dots, sort the files and somehow put the dots back in its place, but this does not seem possible.<br>
<br>
Marlon<br>
______________________________<wbr>_________________<br>
cs631apue mailing list<br>
<a href="mailto:cs631apue@lists.stevens.edu" target="_blank">cs631apue@lists.stevens.edu</a><br>
<a href="https://lists.stevens.edu/mailman/listinfo/cs631apue" rel="noreferrer" target="_blank">https://lists.stevens.edu/mail<wbr>man/listinfo/cs631apue</a><br>
</blockquote></div><br></div>