-
Notifications
You must be signed in to change notification settings - Fork 14
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
is there another way to list all files on Windows? #152
Comments
Thanks for all our troubleshooting around this. There's actually another reason for revisiting this very old code; it can be extremely slow when there are a lot of files/subfolders in the directory scanned, cf. [R-pkg-devel] Unusually long execution time for R.utils::gzip on r-devel-windows, 2024-02-17 (https://stat.ethz.ch/pipermail/r-package-devel/2024q1/010470.html). So, yes, this needs to be fixed, but I'm not sure how. I might end up disabling the use of Before even doing that, I should try to create a unit tests that reproduces the problem you're experiencing using a non-English locale. BTW, what does |
Sys.getlocale()
#> "LC_COLLATE=French_Canada.utf8;LC_CTYPE=French_Canada.utf8;LC_MONETARY=French_Canada.utf8;LC_NUMERIC=C;LC_TIME=French_Canada.utf8" But I work with R with X64 but somehow runs with windows32? Sys.getenv("COMSPEC")
"C:\\WINDOWS\\system32\\cmd.exe" |
Just making notes for the record here. It's not as easy as setting C:\Users\hb>set LANGUAGE=fr_FR.utf8
C:\Users\hb>R
R version 4.3.2 (2023-10-31 ucrt) -- "Eye Holes"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R est un logiciel libre livré sans AUCUNE GARANTIE.
Vous pouvez le redistribuer sous certaines conditions.
Tapez 'license()' ou 'licence()' pour plus de détails.
R est un projet collaboratif avec de nombreux contributeurs.
Tapez 'contributors()' pour plus d'information et
'citation()' pour la façon de le citer dans les publications.
Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
Tapez 'q()' pour quitter R.
> shell("dir")
Volume in drive C has no label.
Volume Serial Number is CEF7-2D3F
Directory of C:\Users\hb
01/11/2023 12:14 <DIR> .
01/11/2023 12:14 <DIR> ..
10/01/2023 12:26 70 .bashrc
... Same with UPDATE: This also means we cannot force English output from within R, which otherwise could have solve the problem reported here. |
@olivroy , as a first step, I've updated the develop branch so that you can disable the call to Sys.setenv(R_R_UTILS_SYS_READLINKS2_WINDOWS = "FALSE")
library(R.utils)
... If it works as intended, you shouldn't get any warnings. |
Hi, thanks for looking into it. Unfortunately it didn't work. I think it is due to a minor typo. Fixed in #154 |
Oops, I thought I fixed that, but that was another typo. Merged. Does it work for you? |
Seems to work! I wonder if you agree that #155 should be merged too? My rationale still holds:
|
This code has been around for a very long time.
R.utils/R/Sys.readlink2.R
Lines 49 to 50 in 0382c2e
Note that code moved to:
R.utils/R/Sys.readlink.Windows.R
Lines 32 to 40 in 2daa30c
Would there be another way to do this?
It feels like windows loses encoding.
Doing dir directly in the terminal works and shows output correctly, while when read in R, loses encoding.
I tried many ways to try and fix it, but I can't find th solution.
When I execute this in the shell
but in R
follow-up to HenrikBengtsson/R.cache#52
The text was updated successfully, but these errors were encountered: