- unlink($link_file);
-
- $counter--;
- if ($counter >= 1) {
- $handle = fopen(VAR_FILES . $md5 . '_count', 'w');
- fwrite($handle, $counter);
- fclose($handle);
- }
- elseif ($counter == 0) {
- if (file_exists(VAR_FILES . $md5 . '_count')) {
- unlink(VAR_FILES . $md5 . '_count');
- }
- $new_name = jirafeau_detect_collision($md5 . '_' . $file_name, VAR_TRASH);
- rename(VAR_FILES . $md5, VAR_TRASH . $new_name);
- }