From 2b756576ac6f048edc93bba005bc342e42558c4e Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Mon, 11 Sep 2023 13:14:08 +0200 Subject: [PATCH] Fixed sink() usage --- R/writeMixtureInfo.R | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/R/writeMixtureInfo.R b/R/writeMixtureInfo.R index 187e793..54e4556 100644 --- a/R/writeMixtureInfo.R +++ b/R/writeMixtureInfo.R @@ -26,8 +26,9 @@ writeMixtureInfo <- function( fid <- load(outPutFile) } else { fid <- -1 - # TODO: replace sink with option that will record input and output - sink("baps4_output.baps", split = TRUE) # save in text anyway. + outPutFile <- file.path(tempdir(), "baps4_output.baps") + message("Output saved to", outPutFile) + sink(outPutFile, split = TRUE) # save in text anyway. } dispLine() @@ -331,5 +332,9 @@ writeMixtureInfo <- function( } } } + # Closing sink(s) + while (sink.number() > 0L) { + sink() + } return(changesInLogml) }