ls

Josef Wolf jw at raven.inka.de
Sat Jan 30 11:59:31 UTC 2010


On Tue, Jan 26, 2010 at 07:50:19PM -0600, Linda wrote:
> The cannot access is the message I was refering to. I was using an ls 
> system call inside of a program.
> ls -1 partial-filename*
> it dumps the results into a file and gives the user a list to choose 
> from.  I just was hoping for a flag to silence the error message but I 
> can redirect standard error instead.

Depending on the type of program you write (e.g. is it security relevant or
should it be robust?), you might consider to use opendir/readdir/closedir.
The system() call uses a shell internally and is prone to all sorts of
attacks and failure modes.




More information about the ubuntu-users mailing list