You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, if you want to start a process in a directory other than R's current dir, you need to call setwd() before starting the process, and then call it again afterward. And for extra safety, you would want to call setwd() in an on.exit, in case there's an error.
old_dir<- setwd(new_dir)
# In case we have an error in process$new(), use on.exit
on.exit(setwd(old_dir))
p<-process$new("ls", stdout="|")$wait()
setwd(old_dir)
It would be nice if there were an option to process$new that let you set the working directory.
The text was updated successfully, but these errors were encountered:
Right now, if you want to start a process in a directory other than R's current dir, you need to call
setwd()
before starting the process, and then call it again afterward. And for extra safety, you would want to callsetwd()
in anon.exit
, in case there's an error.It would be nice if there were an option to
process$new
that let you set the working directory.The text was updated successfully, but these errors were encountered: