moveSingleFile: Moves a file to a new location on Synapse and creates a link...

Description Usage Arguments Examples

Description

Moves a file to a new location on Synapse and creates a link where the file used to be

Usage

1
moveSingleFile(synId, newParentId)

Arguments

synId

the Synapse ID of the file to be moved.

newParentId

the Synapse ID of the new parent folder or project where the file will be moved to.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (synId, newParentId)
{
    foo <- synGet(synId, downloadFile = F)
    oldParentId <- synGetProperties(foo)$parentId
    fileName <- synGetProperties(foo)$name
    moveFile(synId, newParentId)
    makeLink(synId, oldParentId, linkName = fileName)
  }

Sage-Bionetworks/rSynapseUtilities documentation built on May 9, 2019, 12:13 p.m.