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

path_ext_set(): behaviour varies by presence/absence of a parent directory #92

Closed
jennybc opened this Issue Mar 21, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@jennybc
Copy link
Member

jennybc commented Mar 21, 2018

fs::path_ext_set(".rels", "XML")
#> .rels.XML
fs::path_ext_set("_rels/.rels", "XML")
#> _rels.XML
## I expected/wanted "_rels/.rels.XML"

Created on 2018-03-21 by the reprex package (v0.2.0).

I need to copy some XML files that lack the extension to filenames that have the extension, for favorable treatment in a web browser. Above is an example where my attempt to add the extension ultimately results in me making the copy with the wrong name and in the parent of the intended directory.

Can I simply not use path_ext_set() in this case?

@jennybc jennybc changed the title path_ext_set(): behaviour depends on path path_ext_set(): behaviour varies by presence/absence of a parent directory Mar 22, 2018

@jimhester jimhester closed this in 71d8803 Mar 22, 2018

@jimhester jimhester added the bug label Mar 22, 2018

@jimhester

This comment has been minimized.

Copy link
Member

jimhester commented Mar 22, 2018

Ok this should now be fixed, the regex was not handling hidden files in directories correctly.

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