Attempts to connect to the specified file-based engine. Returns FALSE if the file is not available or not properly formatted.

file_engine_check(filename, warn = TRUE)

Arguments

filename

A character string indicating the path to the file-based engine.

warn

A logical indicating whether to print a warning message if with failure information if the database is not available or not properly formatted. Default is TRUE.

Value

TRUE if the database is available and properly formatted, FALSE otherwise.

Examples

print(file_engine_check("https://kghub.io/kg-obo/sepio/2023-06-13/sepio_kgx_tsv.tar.gz"))
#> [1] TRUE
print(file_engine_check("https://no-such-host.kghub.io/sepio_kgx_tsv.tar.gz"))
#> Warning: URL 'https://no-such-host.kghub.io/sepio_kgx_tsv.tar.gz': status was 'Couldn't resolve host name'
#> [1] FALSE
print(file_engine_check(system.file("extdata", "mondo_kgx_tsv.tar.gz", package = "monarchr")))
#> Warning: File does not exist.
#> [1] FALSE
print(file_engine_check(system.file("extdata", "nosuch_kgx_tsv.tar.gz", package = "monarchr")))
#> Warning: File does not exist.
#> [1] FALSE