gesistsa / rio

🐟 A Swiss-Army Knife for Data I/O
http://gesistsa.github.io/rio/
599 stars 76 forks source link

export several files to zip file (#203) #346

Closed schochastics closed 12 months ago

schochastics commented 1 year ago

@chainsawriot please have a look if the logic I used makes sense to you

chainsawriot commented 12 months ago

@schochastics I checked and it works fine, except the case of writing to new directory.

schochastics commented 12 months ago

@chainsawriot Thanks will address the comments

@schochastics I checked and it works fine, except the case of writing to new directory.

Yes forgot to ask you about that. export does not create a new dir if it doesn't exist

R> export(mtcars,"i_dont_exist/test.csv")
Error in data.table::fwrite(x, file = file, sep = sep, row.names = row.names,  : 
  No such file or directory: 'i_dont_exist/test.csv'. Unable to create new file for writing (it does not exist already). Do you have permission to write here, is there space on the disk and does the path exist?

I can make export_list create a new dir if it doesnt exist, but then we probably should also do it for export?

chainsawriot commented 12 months ago

@schochastics Thanks for finding this out. I will open a new issue and fix that.

schochastics commented 12 months ago

@chainsawriot actually since export_list calls export for the default case, I will only implement the "new dir" feature for the archive

chainsawriot commented 12 months ago

@schochastics OK, just leave it like that and I will fix #347

I think the expected output for test_export_list.R:25:5 should be the normalizedPath(archive)

chainsawriot commented 12 months ago

@schochastics Great! Thank you!