First of all, what's this?
$handle = opendir($folder);
if ($handle = opendir($folder)) {
Delete the first one.
Also, is truesize() a function you made yourself? I've never heard of it.
There might be other problems with the script... this is just my initial response.
Edit: Another problem: $file != '../' is wrong. The name would not have a trailing slash.