harrelfe/Hmisc

mdb.get fails when file argument has spaces

cpsyctc opened this issue · 1 comments

I am sorry I am not clued up enough to put this in as pull request (I am not even sure if that's the correct phrase) ... and huge thanks for your work Hmisc has been a life saver for me time and again and back to when it wasn't in R, only in S+ (if my ageing memory has that right).

OK, the issue. It took me a while to work out that the reason mdb.get was failing to read a file was that the file name contained spaces. I think the error message might have been obvious to some but I was being slow. The message I got was:

File not found
Couldn't open database.
Warning message:
In system(paste("mdb-tables -1", file), intern = TRUE) :
  running command 'mdb-tables -1 EOS complete data 2012-2020b.mdb' had status 1

I think the fix is a line:

file <- gsub(" ", "\\\\ ", file)

But perhaps I am not seeing side effects of that and perhaps catching the space and throwing a warning or an error is safer.

Anyway, huge thanks again,

Chris

This should be fixed in the early September 2021 posting to CRAN