clearify everything
This commit is contained in:
parent
0cf2c1af66
commit
7164638d08
@ -45,7 +45,7 @@ getOutFiles <- function(outputLoc, outputNames){
|
||||
return(grep("out$", grep(paste(paste0(outputNames, "*"), collapse = "|"), list.files(outputLoc), value=TRUE), value = TRUE))
|
||||
}
|
||||
|
||||
#' getOutFiles
|
||||
#' stampAndCopy
|
||||
#'
|
||||
#'This function gives us the muso output files with their paths
|
||||
#'
|
||||
@ -54,9 +54,22 @@ getOutFiles <- function(outputLoc, outputNames){
|
||||
#'@return Output files with their paths
|
||||
#'@keywords internal
|
||||
|
||||
stampAndCopyDir <- function(outputLoc,names,stampDir, stampnum=NULL){
|
||||
if(!is.null(stampnum)){file.copy(file.path(outputLoc,names)
|
||||
,file.path(stampDir,paste0((stampnum+1),"-",possibleNames)))
|
||||
} else{file.copy(file.path(outputLoc,names)
|
||||
,file.path(stampDir,paste0((stamp(stampDir)+1),"-",possibleNames)))}
|
||||
stampAndDir <- function(outputLoc,names,stampDir, wrongDir, type="output", errorsign){
|
||||
|
||||
switch(type,
|
||||
"output" = (
|
||||
file.copy(file.path(outputLoc,names)
|
||||
,file.path(stampDir,paste0((stamp(stampDir)+1),"-",names))) ),
|
||||
"epc" = (function (){
|
||||
stampnum <- stamp(stampDir)
|
||||
lapply(names,function (x) file.copy(from = x ,to=paste(stampDir,"/",(stampnum+1),"-", basename(x),sep="")))
|
||||
if(errorsign==1){
|
||||
lapply(names, function (x) file.copy(from = paste(stampDir,"/",(stampnum+1),"-",basename(x),sep=""), to=wrongDir))}})(),
|
||||
"log" = (
|
||||
file.rename(names
|
||||
,file.path(stampDir,paste0((stamp(stampDir)+1),"-",basename(names))))
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -179,8 +179,7 @@ calibMuso <- function(settings,parameters=NULL, timee="d", debugging=FALSE, logf
|
||||
|
||||
if(keepBinary){
|
||||
possibleNames <- getOutFiles(outputLoc = outputLoc,outputNames = outputNames)
|
||||
file.copy(file.path(outputLoc,possibleNames)
|
||||
,file.path(binaryPlace,paste0((stamp(binaryPlace)+1),"-",possibleNames)))
|
||||
stampAndDir(outputLoc = outputLoc,names = possibleNames,stampDir=binaryPlace,type="output")
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,12 +218,7 @@ calibMuso <- function(settings,parameters=NULL, timee="d", debugging=FALSE, logf
|
||||
stop("Why are you playing with my nervs? Seriously? You hold your epc-s in different folders?")
|
||||
} else {
|
||||
|
||||
## epcfiles <- list.files(epcdir)[grep("epc$",list.files(
|
||||
stampnum<-stamp(EPCS)
|
||||
lapply(epc,function (x) file.copy(from = x ,to=paste(EPCS,"/",(stampnum+1),"-", basename(x),sep="")))
|
||||
if(errorsign==1){
|
||||
lapply(epc, function (x) file.copy(from = paste(EPCS,"/",(stampnum+1),"-",basename(x),sep=""), to=WRONGEPC))
|
||||
}
|
||||
stampAndDir(stampDir=EPCS,wrongDir=WRONGEPC,names=epc,type="epc",errorsig=errorsign)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -295,4 +295,13 @@ getyearlyout<-function(settings){
|
||||
## }
|
||||
|
||||
## }
|
||||
## file.copy(file.path(outputLoc,possibleNames)
|
||||
## ,file.path(binaryPlace,paste0((stamp(binaryPlace)+1),"-",possibleNames)))
|
||||
|
||||
|
||||
## epcfiles <- list.files(epcdir)[grep("epc$",list.files(
|
||||
## stampnum<-stamp(EPCS)
|
||||
## lapply(epc,function (x) file.copy(from = x ,to=paste(EPCS,"/",(stampnum+1),"-", basename(x),sep="")))
|
||||
## if(errorsign==1){
|
||||
## lapply(epc, function (x) file.copy(from = paste(EPCS,"/",(stampnum+1),"-",basename(x),sep=""), to=WRONGEPC))
|
||||
## }
|
||||
Loading…
Reference in New Issue
Block a user