简体   繁体   English

dir.create和shinyapps.io的问题

[英]problems with dir.create and shinyapps.io

I am trying to get an application running on shinyapps.io. 我正在尝试让应用程序在Shinyapps.io上运行。 First step is to load a rds file for dropbox access. 第一步是加载rds文件以进行保管箱访问。 The the app is supposed to dowload one folder of the dropbox on the server. 该应用程序应该在服务器上下载保管箱的一个文件夹。

I want to create a directory in the "static" directory of the app. 我想在应用程序的“静态”目录中创建目录。

I tried 我试过了

dir.create (static/...)
dir.create (./static/...)

both works fine locally, but it seems dir.create () does not work on the shinyapps server. 两者在本地都可以正常工作,但是dir.create()在Shinyapps服务器上似乎不起作用。 https://colomb.shinyapps.io/resultsgallery_software/ https://github.com/smartfigures-dar/SmartFig_Rbased_prototype/tree/dropbox_integration https://colomb.shinyapps.io/resultsgallery_software/ https://github.com/smartfigures-dar/SmartFig_Rbased_prototype/tree/dropbox_integration

Note that it seems to work on the 2 first instance and then no more: 请注意,它似乎可以在第2个实例上运行,然后不再起作用:

local: 本地:

for (j in folders$path_display){
print(j)
foldercreated <-dir.create(paste0("./static",j))
}
[1] "/SFB-resultgallery"
[1] "/SFB-resultgallery/Figures"
[1] "/sfb-resultgallery/Figures/atg6-9_KD_in_brain"
[1] "/sfb-resultgallery/Figures/keep_it_short,_no_more_than1"
[1] "/sfb-resultgallery/Figures/2e"
[1] "/sfb-resultgallery/Figures/keep_it_short,_no_more_than"e

shinyapps.io log message: shineapps.io日志消息:

    2019-07-05T09:42:45.679221+00:00 shinyapps[1012452]: [1] "/SFB-resultgallery"
2019-07-05T09:42:45.679636+00:00 shinyapps[1012452]: [1] "/SFB-resultgallery/Figures"
2019-07-05T09:42:45.679740+00:00 shinyapps[1012452]: [1] "/sfb-resultgallery/Figures/atg6-9_KD_in_brain"
2019-07-05T09:42:45.679936+00:00 shinyapps[1012452]: Warnung in dir.create(paste0("./static", j))
2019-07-05T09:42:45.679938+00:00 shinyapps[1012452]:   kann Verzeichnis './static/sfb-resultgallery/Figures/atg6-9_KD_in_brain' nicht erzeugen. Grund 'No such file or directory'

Short answer: never capitalise folder names. 简短答案:请勿大写文件夹名称。

It took forever to get to the problem and solve it, although the problem is tiny: shinyapps.io and windows deal differently with capital letters: things were saved in "Figures/" and the app tries to access "figures/", no to mention that dropbox messes with it too (file in Figures/ are seen in figures/...) 尽管问题很小,但花了永远的时间才能解决问题:shinyapps.io和windows处理大写字母的方式有所不同:事物保存在“ Figures /”中,并且该应用尝试访问“ figures /”,否提到保管箱也弄乱了它(Figures /中的文件,如图/ ...中所示)

I wonder if this is somewhere in the doc... 我想知道这是否在文档中某处...

(I am still struggling with the problem hours after finding it ...) (发现问题后数小时我仍在为之苦苦挣扎...)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM