<div dir="ltr">Thanks for the response.<div><br></div><div>I'm working on the formatting but I wanted to leave that as the last thing and focus on all the functionality first. Again 9/10 times it's fine it's that 1 other time that I need to fix. <br>
<div><br></div><div>The -d example you gave makes more sense as a use case and I see the differences.</div><div><br></div><div>On the recursive, the latter output is what mine does which is the problem. I think it's because I'm purely using fts_read in my program and haven't used fts_children. I can see how using fts_children could allow the output to be formatted that way since you're reading one directory at a time where as with fts_read you're reading the hierarchy as it traverses. I'll have to redo some of my code and approach to handle being able to output correctly.</div>
<div><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Oct 5, 2013 at 2:17 PM, Jan Schaumann <span dir="ltr"><<a href="mailto:jschauma@stevens.edu" target="_blank">jschauma@stevens.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Tejas Nadkarni <<a href="mailto:tnadkarn@stevens.edu" target="_blank">tnadkarn@stevens.edu</a>> wrote:<br>
<br>
> - How important is variable column width that's dynamic to the content like<br>
> the system 'ls' implementation does - this is specific to the -l<br>
> longformat. Is this required and will points be deducted? Mine uses fixed<br>
> widths which work for nearly every condition but obviously large file sizes<br>
> will throw it off. Want to check before I invest more time in it<br>
<br>
</div>It's not functionally crucial, but you should try to make an effort to<br>
handle this.<br>
<br>
As noted before, we are writing system tools conceptually suitable for<br>
inclusion in the OS as a core component. If you used the command<br>
provided by the system, and it garbled the output or took obvious short<br>
cuts, you'd likely think less of the system. Formatting etc. tends to<br>
reflect on the overall care paid to the program.<br>
<div><br>
> - What is the point of the '-d' flag?<br>
<br>
</div>The '-d' flag is useful when you want to display certain entries without<br>
recursing into them should they happen to be directories. Suppose you<br>
want to get the long listing information of all entries starting with<br>
the letter 'b' under '/':<br>
<br>
ls -l /b*<br>
<br>
will open the /bin directory and instead give you the information about<br>
the files in that directory.<br>
<br>
ls -ld /b*<br>
<br>
will do the right thing.<br>
<div><br>
<br>
> It's not clear if all we're doing is printing out the path or cwd and<br>
> exiting?<br>
<br>
</div>You should, as the manual page states, list directories encountered as<br>
plain files (and not list their contents, as you would without the '-d'<br>
flag) and not follow symbolic links given as arguments.<br>
<br>
ln -s / foo<br>
ls foo<br>
ls -ld foo<br>
ls -d foo<br>
<div><br>
> - the extra credit to implement -c that's for ls with the short format<br>
> right? i.e. not -l because we have to multi-column output for '-l' already.<br>
> I'm assuming then that -c is only valid without -l<br>
<br>
</div>Correct. '-c' changes the default output format of your program from<br>
'-1' to match that of the system provided ls(1).<br>
<div><br>
<br>
> Currently mine just prints out the files/directories as it traverses<br>
> based on sort. Any thoughts?<br>
<br>
</div>I'm not sure I understand your question correctly, but: Your program<br>
needs to show the user which files belong to which directory. That is,<br>
a single list of all files without any indication of what subdirectory<br>
they were found in would not be reasonable.<br>
<br>
For example:<br>
<br>
mkdir -p dir/subdir/subsubdir<br>
touch dir/file dir/subdir/file dir/subdir/subsubdir/file<br>
ls -R<br>
.:<br>
dir<br>
<br>
./dir:<br>
file subdir<br>
<br>
./dir/subdir:<br>
file subsubdir<br>
<br>
./dir/subdir/subsubdir:<br>
file<br>
<br>
<br>
allows the user to see which files exist where. If you printed<br>
<br>
ls -R<br>
dir<br>
file subdir<br>
file subsubdir<br>
file<br>
<br>
then it would be confusing for the user to figure out which 'file'<br>
resides where.<br>
<br>
<br>
If you meant something else, perhaps show examples of your program's<br>
output versus the system command's.<br>
<span><font color="#888888"><br>
-Jan<br>
</font></span><div><div>_______________________________________________<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" target="_blank">https://lists.stevens.edu/mailman/listinfo/cs631apue</a><br>
</div></div></blockquote></div><br></div></div></div></div>