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

Warnings about file.rename when downloading reports #45

Closed
see24 opened this issue Jan 30, 2024 · 0 comments
Closed

Warnings about file.rename when downloading reports #45

see24 opened this issue Jan 30, 2024 · 0 comments
Assignees

Comments

@see24
Copy link
Contributor

see24 commented Jan 30, 2024

I installed the development branch and am now getting a bunch of warnings when I download files with wt_download_report. It looks like the commit to remove special characters from project names is causing issues for my Windows file paths which contain ~ and :

Warning:
1: In file.rename(.x, gsub("[:()?!;]", "", .x)) :
cannot rename file 'C:\Users\ENDICO
1\AppData\Local\Temp\RtmpygiPXo/BU_Big_Grid_Pilot_Program_2014_recording_report.csv' to 'C\Users\ENDICO1\AppData\Local\Temp\RtmpygiPXo/BU_Big_Grid_Pilot_Program_2014_recording_report.csv', reason 'The system cannot find the path specified'

If you change this line
to:

list.files(td, pattern = "*.csv") %>% 
  purrr::map(~file.rename(file.path(td, .x), file.path(td, gsub("[:()?!~;]", "", .x))))

It will only change the parts after the temp dir

see24 added a commit to see24/wildRtrax that referenced this issue Jan 31, 2024
@alexmacphail alexmacphail self-assigned this Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants