Révision 5e1de699
| b/src/DESCRIPTION | ||
|---|---|---|
| 1 | 1 |
Package: cachecache |
| 2 | 2 |
Maintainer: Florent Chuffart <florent.chuffart@ens-lyon.fr> |
| 3 | 3 |
Author: Florent Chuffart |
| 4 |
Version: 0.1
|
|
| 4 |
Version: 0.2
|
|
| 5 | 5 |
License: CeCILL |
| 6 | 6 |
Title: cachecache |
| 7 | 7 |
Depends: |
| b/src/R/cachecache.R | ||
|---|---|---|
| 1 | 1 |
get_content = structure( function(## Get content from cached |
| 2 | 2 |
### Access to the cached content of a file via the global variable CACHE_CACHE. Load content in CACHE_CACHE if needed. |
| 3 |
filename, ##<< The path to the file that contain dataset. |
|
| 4 |
class=NULL, ##<< The class of dataset. |
|
| 3 |
filename, ##<< The path to the file that contain dataset |
|
| 4 |
class=NULL, ##<< The class of dataset |
|
| 5 |
FORCE_RELOAD=FALSE, ##<< Force cachecache to reload the value |
|
| 5 | 6 |
... ##<< Parameters that will be passed to my_read |
| 6 | 7 |
) {
|
| 7 | 8 |
if (inherits(try(CACHE_CACHE,TRUE), "try-error") || is.null(CACHE_CACHE)) {
|
| ... | ... | |
| 9 | 10 |
} |
| 10 | 11 |
obj = list(filename=filename) |
| 11 | 12 |
class(obj) = class |
| 12 |
if (is.null(CACHE_CACHE[[obj$filename]])) {
|
|
| 13 |
if (is.null(CACHE_CACHE[[obj$filename]]) | FORCE_RELOAD) {
|
|
| 13 | 14 |
print(paste("Loading file ",obj$filename, sep=""))
|
| 14 | 15 |
tmp_content = my_read(obj, ...) |
| 15 | 16 |
print("affect it...")
|
Formats disponibles : Unified diff