On Fri, 2004-02-20 at 17:35, YC Nyon wrote:
Hi,
I want to delete files than are older than 1 week from a specific directory.
Anyone mind to share their code? Can't anything on phpbuilder on this.
Regards
Nyon
I have a bash script that I use:
#! /bin/bash
# call as: ./delete_old.sh
Hi,
I want to delete files than are older than 1 week from a specific directory.
Anyone mind to share their code? Can't anything on phpbuilder on this.
Regards
Nyon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I want to delete files than are older than 1 week from a specific
directory. Anyone mind to share their code? Can't anything on phpbuilder
on this.
If you're running PHP under unix:
http://marc.theaimsgroup.com/?l=php-generalm=106002263306528w=2
Hi
Here's a little function I made up for this:
?php
function delete_old_files($dir, $time_limit = 0){
if(!$time_limit) $time_limit = 7*24*60*60;
if ($df = opendir($dir)) {
while (false !== ($file = readdir($df))) {
if ($file != . $file != ..) {
$last_modified = filemtime($file);
4 matches
Mail list logo