Also $file doesn't contain what you assume it does, hence all your deletes fail when you prepend the path.
In reply to Re^2: File deletion by marto in thread File deletion by 14sudharsan