protected static function checkFileWritableJob(string $path, bool $truncate = false): bool
    {
        if (\file_exists($path) && (!\is_file($path) || !\is_writable($path))) {
            return false;
        }
        
        if ($truncate && \is_file($path)) {
            @\ftruncate(@\fopen($path, 'wb'), 0);
        }
        
        return true;
    }