Purrr FAILS with md5sum and multiple files

purrr
fs

#1

Hello there!

I have a bunch of zipped files and I need to compute a md5sum for each of them.
I believe I am using the tidyverse state-of-the-art:

library(fs)
library(purrr)

local_list <- dir_info('/mypath/mydata/, glob = '*.gz') %>%
pluck('path') %>% as.list()

map(local_list, tools::md5sum)

However this fails on an error 502 and crashes my Rstudio.
Instead, running md5sum() on a single file works. What can be the issue here?

Thanks!


#2

I get the sense that md5sum() does not like the list input, so you may need to do something like: map(local_list, ~tools::md5sum(.x[[1]])). Another option could be not do coerce as.list(), but I'm not sure about that output. A definite way to know what's being passed to md5sum() would be to run print() and see what's being output: map(local_list, print)