If you're only executing one-liners and get all the results back you're
better off using shell_exec(). popen() lets you open a pipe to a
command--that way, you can funnel data to it as if you were typing from
the keyboard.
Permissions would be a problem with readdir() as well.
Marco
--
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmer
Come visit us at http://www.phparch.com!
--- Begin Message ---
<<Well, as a general rule, it won't work if you're not
using a UNIX o/s orif PHP has been set up with safe
mode on, or if you don't have the rightpermission to
see that folder. That's probably a non-inclusive list,
butthere should be ways around each of these problems
(depending on thedegree of control you have over the
server).>>
These are fine. I'm not going to use Windows for a
server. Won't the same problem in relation to
directory permissions stop me even if I just did a
simple readdir()? The only one I'm too worried about
is the safe mode thing. It works for now, though. The
next server I'm moving to will hopefully be my own, so
I'll have complete control. And, if not, all of my
shell_execs() are in a function, so I only have to
change it in one place.
But is it less troublesome to use a popen instead of
shell_exec? What are the differences, aside from that
popen remains open past one command? I'm using both
here and there in my site, and am wondering if one is
better than the other if all my shell commands are
single-line commands.
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
--- Begin Message ---
<<Well, as a general rule, it won't work if you're not
using a UNIX o/s orif PHP has been set up with safe
mode on, or if you don't have the rightpermission to
see that folder. That's probably a non-inclusive list,
butthere should be ways around each of these problems
(depending on thedegree of control you have over the
server).>>
These are fine. I'm not going to use Windows for a
server. Won't the same problem in relation to
directory permissions stop me even if I just did a
simple readdir()? The only one I'm too worried about
is the safe mode thing. It works for now, though. The
next server I'm moving to will hopefully be my own, so
I'll have complete control. And, if not, all of my
shell_execs() are in a function, so I only have to
change it in one place.
But is it less troublesome to use a popen instead of
shell_exec? What are the differences, aside from that
popen remains open past one command? I'm using both
here and there in my site, and am wondering if one is
better than the other if all my shell commands are
single-line commands.
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
--- End Message ---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php