【发布时间】:2014-02-20 12:00:00
【问题描述】:
也许这是一些微不足道的事情,我只是在同一个代码中寻找太久...当通过 RStudio 采购 R 模块 getFLOSSmoleDataXML.R 时,代码正确检测到 cache 目录中的 .Rdata 文件并跳过下载和解析阶段.另一方面,当 R 通过 GNU make (sudo -u ruser make) 处理相同的模块时,结果很奇怪:
Rscript --no-save --no-restore --verbose getFLOSSmoleDataXML.R
running
'/usr/lib/R/bin/R --slave --no-restore --no-save --no-restore --file=getFLOSSmoleDataXML.R'
Loading required package: RCurl
Loading required package: methods
Loading required package: bitops
Loading required package: XML
Loading required package: digest
Verifying repository: FreeCode
Checking file "http://flossdata.syr.edu/data/fc/2013/2013-Dec/fcProjectAuthors2013-Dec.txt.bz2"...
rdataFile = "./cache/5802dbd08ebefadf70fbb826776f9f0f.Rdata"...
trying URL 'http://flossdata.syr.edu/data/fc/2013/2013-Dec/fcProjectAuthors2013-Dec.txt.bz2'
Content type 'application/x-bzip2' length 514960 bytes (502 Kb)
opened URL
==================================================
downloaded 502 Kb
Error in gzfile(file, "wb") : cannot open the connection
Calls: print ... FUN -> importRepoFiles -> lapply -> FUN -> save -> gzfile
In addition: Warning message:
In gzfile(file, "wb") :
cannot open compressed file './cache/5802dbd08ebefadf70fbb826776f9f0f.Rdata', probable reason 'No such file or directory'
Timing stopped at: 0.74 0.068 1.134
Execution halted
make[1]: *** [importFLOSSmole] Error 1
make[1]: Leaving directory `/home/ruser/diss-floss/import'
make: *** [collection] Error 2
ubuntu@ip-10-164-108-61:/home/ruser/diss-floss$ ls -l cache/5802*
-rw-r--r-- 1 ruser ruser 1968939 Feb 19 05:47 cache/5802dbd08ebefadf70fbb826776f9f0f.Rdata
正如您从最后两行看到的,我验证并确认该文件确实存在。这里发生了什么?有什么想法或建议吗?谢谢!
【问题讨论】:
-
嗯,这不是“可能的原因”。错误消息并不完美。我不知道为什么有人试图在
.Rdata文件上使用gzfile,但它肯定不是 zip 文件,因此无法解压缩。 -
@CarlWitthoft:我同意——有些地方很不对劲——很可能是我在代码中的某个地方出错了。我将再次深入研究这个问题并报告我的发现。感谢您为我指明正确的方向!
标签: r build gnu-make rstudio rdata