# Note: a time limit can be set in order to kill the operation when/if
# the NCBI/Entrez server becomes unresponsive.
setTimeLimit(elapsed = 4.9)
try({
x <- epm_query(query_string = 'Damiano Fantini[AU] AND "2018"[PDAT]')
x <- epm_fetch(x = x, format = 'xml', write_to_file = TRUE,
outfile_prefix = 'test', store_contents = FALSE)
y <- epm_import_xml('test_batch_01.txt')
tryCatch({unlink('test_batch_01.txt')}, error = function(e) { NULL })
print(paste0(' Raw Record Num (fetched): ',
getEPMMeta(x)$raw_record_num))
print(paste0('Raw Record Num (read & rebuilt): ',
getEPMMeta(y)$raw_record_num))
}, silent = TRUE)
setTimeLimit(elapsed = Inf)
Run the code above in your browser using DataLab