Fixed “state_file_absolute_path” check: now gancioff actually checks for its writeability too, instead of checking 2 times for its readability

This commit is contained in:
pezcurrel 2024-10-24 12:59:41 +02:00
parent 865f4b09c6
commit 103699125f

View file

@ -273,7 +273,7 @@ if (is_null($opts['do-post'])) $opts['do-post']=true;
if (file_exists($conf['state_file_absolute_path'])) { if (file_exists($conf['state_file_absolute_path'])) {
if (!is_file($conf['state_file_absolute_path'])) dieYoung("Error: «{$conf['state_file_absolute_path']}» exists but its not a file.\n",1); if (!is_file($conf['state_file_absolute_path'])) dieYoung("Error: «{$conf['state_file_absolute_path']}» exists but its not a file.\n",1);
if (!is_readable($conf['state_file_absolute_path'])) dieYoung("Error: «{$conf['state_file_absolute_path']}» exists but its not readable.\n",1); if (!is_readable($conf['state_file_absolute_path'])) dieYoung("Error: «{$conf['state_file_absolute_path']}» exists but its not readable.\n",1);
if (!is_readable($conf['state_file_absolute_path'])) dieYoung("Error: «{$conf['state_file_absolute_path']}» exists but its not writable.\n",1); if (!is_writeable($conf['state_file_absolute_path'])) dieYoung("Error: «{$conf['state_file_absolute_path']}» exists but its not writable.\n",1);
$guids=[]; $guids=[];
$buff=file($conf['state_file_absolute_path'],FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); $buff=file($conf['state_file_absolute_path'],FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
$graceTime=365*24*60*60; $graceTime=365*24*60*60;