Photo by @uniqueton. Runtime errors can be tricky and costly to resolve for any programming language, and these errors frequently happen when managing (file) connections. Boris posted such an issue when using my R package Rcpi. I rephrase it here as: library("Rcpi") dir.create("test") for (i in 1:2000) { file.copy( system.file("compseq/DB00530.sdf", package = "Rcpi"), paste0("test/", i, ".sdf") ) } fns <- list.files("test/", pattern = ".sdf$", full.names = TRUE) for (i in 1:length(fns)) { cat("\014", …