Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Wrong number of arguments" when filename contain space or special characters #7

Closed
xlai opened this issue Nov 11, 2022 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@xlai
Copy link

xlai commented Nov 11, 2022

This is a problem that applied to both mdb_table and read_mdb function when path or filename contains spaces or other specials.

filename <- "path to file\filename.mdb"
mdb_tables(filename)

produces the following error

 Wrong number of arguments.
Usage:
  mdb-tables [OPTION…] <file> - show MDB files tables/entries

Help Options:
  -h, --help               Show help options

Application Options:
  -S, --system             Include system tables
  -1, --single-column      One table name per line
  -d, --delimiter=char     Table name delimiter
  -t, --type=type          Type of entry
  -T, --showtype           Show type
  --version                Show mdbtools version and exit

Valid types are: form table macro systable report query linkedtable module relationship dbprop any all 

This can be resolved by adding shQuote() around file in the undelying system2 call.

@xlai
Copy link
Author

xlai commented Nov 11, 2022

Sorry I didn't check against your source code. It seems like it's only a problem with the version on CRAN with tag 0.1.2

@k5cents
Copy link
Owner

k5cents commented Nov 11, 2022

I don't think I intended to make this fix, but if it's fixed accidentally in v0.2.0 then fantastic! If not, feel free to submit a PR.

I can wait for a PR or I can submit v0.2.0 to CRAN, which I should have done a while ago.

@k5cents k5cents added the bug Something isn't working label Nov 11, 2022
@xlai
Copy link
Author

xlai commented Nov 14, 2022

thanks! I think i've patched the only one i found. I will close this issue now :)

@xlai xlai closed this as completed Nov 14, 2022
@k5cents
Copy link
Owner

k5cents commented Nov 14, 2022

Whoops! I sent v0.2.0 to CRAN the other day, which has the other shQuote() added but not to the place your PR added it.

You can get the development version 0.2.0.9 from GitHub with your fix.

I will send your fix to CRAN in 0.2.1 later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants