Closed vnijs closed 6 years ago
The errors are coming when trying to colorize the paths for display, which you can disable by setting Sys.setenv(LS_COLORS = "")
Hmmmm.
> Sys.setenv(LS_COLORS = "")
> fs::dir_ls("C:")
Error: [EBUSY] Failed to stat 'C:/hiberfil.sys': resource busy or locked
> devtools::session_info()
Session info -------------------------------------------------------------------------------------------
setting value
version R version 3.5.1 (2018-07-02)
system x86_64, mingw32
ui RStudio (1.2.679)
language (EN)
collate English_United States.1252
tz America/Los_Angeles
date 2018-07-12
Packages -----------------------------------------------------------------------------------------------
package * version date source
base * 3.5.1 2018-07-02 local
compiler 3.5.1 2018-07-02 local
crayon 1.3.4 2017-09-16 CRAN (R 3.5.0)
datasets * 3.5.1 2018-07-02 local
devtools 1.13.6 2018-06-27 CRAN (R 3.5.0)
digest 0.6.15 2018-01-28 CRAN (R 3.5.0)
fs 1.2.3 2018-06-08 CRAN (R 3.5.1)
graphics * 3.5.1 2018-07-02 local
grDevices * 3.5.1 2018-07-02 local
memoise 1.1.0 2017-04-21 CRAN (R 3.5.0)
methods * 3.5.1 2018-07-02 local
Rcpp 0.12.17 2018-05-18 CRAN (R 3.5.0)
rstudioapi 0.7.0-9001 2018-05-25 local
stats * 3.5.1 2018-07-02 local
tools 3.5.1 2018-07-02 local
utils * 3.5.1 2018-07-02 local
withr 2.1.2 2018-03-15 CRAN (R 3.5.0)
Any additional suggestions @jimhester since Sys.setenv(LS_COLORS = "")
doesn't' seem to do the trick? Am I missing something?
Should now be fixed.
I'm having trouble building the package on Windows. I tried using `devtools::build_win(version = "R-release") but that gives similar error messages (see link below). Any suggestions?
https://win-builder.r-project.org/Agct9Q7ZP1NV/00install.out
==> Rcmd.exe INSTALL --no-multiarch --with-keep.source fs
* installing to library 'C:/R/R-3.5.1/library'
* installing *source* package 'fs' ...
** libs
c:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o fs.dll tmp.def error.o utils.o link.o path.o dir.o file.o fs.o id.o windows/getmode.o RcppExports.o ./libuv/libuv.a -lpthread -lws2_32 -lkernel32 -lpsapi -liphlpapi -lshell32 -luserenv -LC:/R/R-35~1.1/bin/x64 -lR
C:\Rtools\mingw_64\bin\nm.exe: error.o: File format not recognized
C:\Rtools\mingw_64\bin\nm.exe: utils.o: File format not recognized
C:\Rtools\mingw_64\bin\nm.exe: link.o: File format not recognized
C:\Rtools\mingw_64\bin\nm.exe: path.o: File format not recognized
C:\Rtools\mingw_64\bin\nm.exe: dir.o: File format not recognized
C:\Rtools\mingw_64\bin\nm.exe: file.o: File format not recognized
C:\Rtools\mingw_64\bin\nm.exe: fs.o: File format not recognized
C:\Rtools\mingw_64\bin\nm.exe: id.o: File format not recognized
C:\Rtools\mingw_64\bin\nm.exe: RcppExports.o: File format not recognized
error.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'fs'
* removing 'C:/R/R-3.5.1/library/fs'
* restoring previous 'C:/R/R-3.5.1/library/fs'
In R CMD INSTALL
Exited with status 1.
It looks like you have stale object files in your src directory, try deleting them and trying again.
Works great now. Thanks @jimhester!
It seems I spoke somewhat too soon. fs::dir_ls
works fine, but I'm having similar problems with fs::file_info
and fs::dir_info
(see below).
> Sys.setenv(LS_COLORS = "")
> files <- fs::dir_ls("C:/")
> fs::file_info(files)
Error: [EBUSY] Failed to stat 'C:/hiberfil.sys': resource busy or locked
> fs::dir_info("C:/")
Error: [EBUSY] Failed to stat 'C:/hiberfil.sys': resource busy or locked
I expect this is related as well:
> file.exists("C:/PerfLogs")
[1] TRUE
> fs::file_exists("C:/PerfLogs")
Error: [EPERM] Failed to stat 'C:/PerfLogs': operation not permitted
Those are all expected, if you can't stat those files than you can't retrieve information about them.
Even for fs::file_exists
? It seems that fs::file_access("C:/PerfLogs", "exists")
does work but fs::file_exists("C:/PerfLogs")
does not. Can you explain why file.exist
does work then?
The issue with fs::file_info(files)
and `fs::dir_info("C:/") is that it doesn't return any information at all due to an error with one (or a few) files. Is there an example you could point to perhaps on how to best return a tibble with results for those files for which results are possible?
I'm using shinyFiles as a (server-side) file-browser for shiny apps. Works great on Mac, Linux, Rstudio-desktop, and Rstudio-server but ... Windows causes some problems. e.g., directories with non-latin characters (e.g., папка) are translated fo "?????" which is not great (see example below). It seems
fs
can deal with these types of issues much better but I'm hitting some snags there as well.list.files("C:")
has only one problems (note the ???? directory) butfs::dir_ls("C:")
only returns an error.Is there a work around you can suggest @jimhester? Thanks.
Example
If I try to eliminate the
.sys
files I get: