Created
August 8, 2012 14:39
-
-
Save simecek/3295533 to your computer and use it in GitHub Desktop.
Get Dropbox Folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get.dropbox.folder <- function() { | |
if (!require(RCurl)) stop ("You need to install RCurl package.") | |
if (Sys.info()["sysname"]!="Windows") stop("Currently, 'get.dropbox.folder' works for Windows only. Sorry.") | |
db.file <- paste(Sys.getenv('APPDATA'), '\\Dropbox\\host.db', sep='') | |
base64coded <- readLines(db.file, warn=FALSE)[2] | |
base64(base64coded, encode=FALSE) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what are the implementations of this function? I am using Rstudio, and to customize the startup I use the .Rprofile to load the packages I need frequently, but given that a dropbox would help to synchronize the package libraries, which would be a pain to keep them in parity with a different machine at work e.g. (esp. when a proxy is out there!). So my thought is to keep a folder for all the packages in a dropbox folder and to make the .Rprofile to source from that folder in the dropbox cloud each time using such a function but am I thinking right, or missing something? but I got double "" in the output for that function, shouldn't be one backslash for the destination? "C:\Users\Dropbox" instead of "C:\Users<NAME>\Dropbox"?