thomasp85 / shinyFiles

A shiny extension for server side file access
196 stars 47 forks source link

Directories not shown when using shinyDirChoose in macOS Mojave #106

Closed AngelosPsy closed 6 years ago

AngelosPsy commented 6 years ago

Hi,

Thank you for all your work; shinyFiles is an extremely useful package!

I recently bought a new laptop and I installed macOS Mojave. When I tried to run a shiny application, that used to work fine in Sierra, I encountered a problem when I use getVolumes inside the shinyDirChoose function. Specifically, the application returns the directory window, without however being able to select any directory; also the subdirectories included in the root directory (in the example below the root directory is Macintosh HD) are not shown. Here is a minimal example:

library(shiny)
library(shinyFiles)

ui <- shinyUI(bootstrapPage(
  shinyDirButton('folder', 'Folder select', 'Please select a folder', FALSE)))

server <- shinyServer(function(input, output) {
  shinyDirChoose(input, 'folder', roots=getVolumes())
  return(print(getwd()))
})

runApp(list(ui=ui, server=server))

and here is the resulting window

delete1

I can, sort of, make this work by using the code below:

library(shiny)
library(shinyFiles)

ui <- shinyUI(bootstrapPage(
  shinyDirButton('folder', 'Folder select', 'Please select a folder', FALSE)))

server <- shinyServer(function(input, output) {
  shinyDirChoose(input, 'folder', roots=c(wd = "."))
  return(print(getwd()))
})

runApp(list(ui=ui, server=server))

And the resulting window looks like this: delete22

However, now I can see the directories/files in my working directory only and I cannot browse to the rest of the folders.

Do you know how I will be able to make shinyDirChoose point to the root directory?

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.14

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] shinyFiles_0.7.1 shiny_1.1.0     

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.19    crayon_1.3.4    digest_0.6.18   later_0.7.5     mime_0.6        R6_2.3.0        xtable_1.8-3    jsonlite_1.5    magrittr_1.5   
[10] pillar_1.3.0    rlang_0.2.2     rstudioapi_0.8  fs_1.2.6        promises_1.0.1  tools_3.5.1     httpuv_1.4.5    yaml_2.2.0      compiler_3.5.1 
[19] htmltools_0.3.6 tibble_1.4.2   
vnijs commented 6 years ago

Can you try the current version of shinyFiles in GitHub? Use the command below. I think that should already resolve the issue.

remotes::install_github("thomasp85/shinyFiles")

Also, does shinyFiles::shinyFilesExample() work on your system?

AngelosPsy commented 6 years ago

Thank you @vnijs! Updating to the most recent github version via remotes solved the problem. I will close the use.

vnijs commented 6 years ago

Great! Thanks for reporting back @AngelosPsy

@thomasp85 Unless you or @AFriendlyRobot have some ideas (and plans) to address https://github.com/thomasp85/shinyFiles/issues/101 could you push 0.7.2 on github to CRAN?