Page 1 of 1
Rename of multiple files
Posted: Fri Jan 09, 2004 9:19 am
by mcurry
I am going to be moving multiple files often. Will it be more efficient to run a while loop and use the rename function or run one exec command with a wildcard. Any other pros/cons that I should be aware of if I use the exec function? This is in linux. Thanks.
Posted: Mon Jan 12, 2004 6:58 pm
by AVATAr
In PHP, there are several different ways to execute system calls. Specifically, the system(), exec(), passthru(), popen(), and the backtick (`) operator all allow you to execute operating-system commands from within your scripts. Each of these functions can also, if used improperly, provide a wide-open door for a malicious user to execute system commands on your server. As was the case when accessing files, most of the time these security holes occur when a system command is being executed based on input from an insecure outside source.
http://www.onlamp.com/pub/a/php/2003/08 ... tions.html
Posted: Mon Jan 12, 2004 8:12 pm
by Straterra
He he he..what is this? A benefit to using Windows? NO WAY!

Posted: Mon Jan 12, 2004 9:24 pm
by Pyrite
If I were you I wouldn't rename files using PHP at all.