Fixed checking exists a file to create a cache

https: //github.com/torrentpier/torrentpier/pull/481
Co-Authored-By: Vasily Komrakov <425040+diolektor@users.noreply.github.com>
This commit is contained in:
Roman Kelesidis 2023-03-09 16:30:55 +07:00
commit 2bc28aa29f

View file

@ -253,7 +253,7 @@ function file_write($str, $file, $max_size = LOG_MAX_SIZE, $lock = true, $replac
rename($file, $new_name); rename($file, $new_name);
} }
} }
if (file_exists($file) && $dir_created = bb_mkdir(dirname($file))) { if (!file_exists($file) && $dir_created = bb_mkdir(dirname($file))) {
$fp = fopen($file, 'ab+'); $fp = fopen($file, 'ab+');
} }
if (isset($fp)) { if (isset($fp)) {