Fetch a Stored Value and Write It to a File

Description

Fetch a value of a netWorkSpace variable and write it to a file.

Usage

1
2
## S4 method for signature 'netWorkSpace'
nwsFetchTryFile(.Object, xName, fObj)

Arguments

.Object

a netWorkSpace object.

xName

character string specifying name of the variable to find.

fObj

file object or character string specifying file to write data to.

Details

The nwsFetchTryFile method looks in the shared netWorkSpace .Object for a value bound to xName; if it finds such a value, nwsFetchTryFile writes the value to the specified file, removes it from the variable, and the method returns TRUE. If it is not found, nwsFetchTryFile returns FALSE.

See Also

nwsFindTryFile, nwsFetchTry

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.