I am using the below code to write an encrypted file from R. It works from R 3.4.3 console, but not in RStudio
zz <- pipe("gpg.exe --encrypt --recipient me --output C:\\Temp\\test.gpg","w") cat("testing\n",file=zz) close(zz)
In RStudio one difference I notice is after saving zz, the description is actually description “C:\Windows\system32\cmd.exe /c gpg.exe --encrypt --recipient me --output C:\Temp\test.gpg”, but in R console the description is exactly as entered.
Both R and RStudio produce the output file test.gpg, but the test.gpg file produced in RStudio is apparently garbled and cannot be decrypted: gpg: [don’t know]: 1st length byte missing
Is there a way to configure RStudio to not prepend what I’m guessing is %comspec% /C to the pipe description?