Page 1 of 1

Unix-lookalike dir listing

Posted: Mon Mar 06, 2006 10:29 pm
by Shendemiar
On my page i need to show the contents of a directory. I currently imitate loosely the looks uf unix shell. Is there an easy way to make perfect imitation, say actually executing "ls -la" and capturing the output, or a ready class that gives accurate match. I know it isnt too complicated to do oneself, just asking if its allready done or a simple way to use the actual.

Posted: Tue Mar 07, 2006 2:11 am
by shiznatix
well you can always do exec('ls -la') but i am not sure if you can grab that output or not. take a look at the exec() function and maybe try somthing like this

Code: Select all

$list = exec('ls -la');
echo $list;

Posted: Tue Mar 07, 2006 3:40 am
by Weirdan

Code: Select all

passthru('ls -la');