Rename of multiple files
Moderator: General Moderators
Rename of multiple files
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.
- AVATAr
- Forum Regular
- Posts: 524
- Joined: Tue Jul 16, 2002 4:19 pm
- Location: Uruguay -- Montevideo
- Contact:
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
http://www.onlamp.com/pub/a/php/2003/08 ... tions.html