nwsFetchTryFile {nws} | R Documentation |
Fetch a value of a workspace variable and write it to a file.
## S4 method for signature 'netWorkSpace': nwsFetchTryFile(.Object, xName, fObj)
.Object |
a netWorkSpace object |
xName |
name of the variable to find |
fObj |
File to write data to |
The nwsFetchTryFile method trys to find a value in the variable specified by 'xName'. If found, the value is removed from the variable, it writes the value to the file object, and the method returns TRUE. If it is not found, it simply returns FALSE.
## Not run: ws <- netWorkSpace('nws example') nwsStore(ws, 'x', 'Hello, world\n') if (nwsFetchTryFile(ws, 'x', 'hello.txt')) { cat('success\n') } else { cat('failure\n') } ## End(Not run)