[cs631apue] midterm project question

Jan Schaumann jschauma at stevens.edu
Thu Oct 13 18:45:37 EDT 2011


afonsec1 <afonsec1 at stevens.edu> wrote:
> I couldn't understand the requirements for runing the programing with no 
> arguments, ie:[ myshell~$ ls ].

No, as per the manual page provided to you, your program may be given
any number of arguments.

> What is the output format for typing ls alone?

As per the manual page provided to you:

"By default, ls lists one entry per line to standard output."

> Also should we considered thread safety?

In what way do you think the given program may need to consider this?

> Also, if a user create/delete a file after a directory content is read  
> but before it gets display... How should we handle that case?

The same way the existing ls(1) program does.  (Which is to say, there
isn't a whole lot you can do, but your program must not segfault or
anything like that and handle any/all errors in a reasonable manner.)

-Jan


More information about the cs631apue mailing list