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

write_csv silently fails when directory doesn't exist #172

Closed
dchudz opened this Issue May 18, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@dchudz

dchudz commented May 18, 2015

write_csv(cars, "this/directory/doesnt/exist/cars.csv")

... doesn't succeed, but also doesn't give an error (latest master, and the version on CRAN). Seems like it would be better to have an error (like write.csv does)?

My system details, in case that matters:

                                                                                           sysname 
                                                                                          "Darwin" 
                                                                                           release 
                                                                                          "13.1.0" 
                                                                                           version 
"Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64" 
                                                                                          nodename 
                                                                                    "davids-mbp-4" 
                                                                                           machine 
                                                                                          "x86_64" 
                                                                                             login 
                                                                                           "david" 
                                                                                              user 
                                                                                           "david" 
                                                                                    effective_user 
                                                                                           "david" 
> 
@dchudz

This comment has been minimized.

dchudz commented May 18, 2015

Hmm, I looks like maybe this is intentional? (mustWork=FALSE in normalizePath: https://github.com/hadley/readr/blob/master/R/write.R#L33).

But I don't understand why.

@hadley

This comment has been minimized.

Member

hadley commented May 18, 2015

The file won't exist yet, so normalizePath() will warn otherwise. I think the error checking needs to happen in the C++

@dchudz

This comment has been minimized.

dchudz commented May 18, 2015

Ah right, sorry!

(It wouldn't be good to handle it with an assertion that file.exists(dirname(path))?)

@hadley hadley closed this in 3cae46d Jul 9, 2015

@lock lock bot locked and limited conversation to collaborators Sep 25, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.