Written by

Question Rajat Sharma · Nov 9, 2020

GNUpg command to encrypt/decrypt a file is working fine on InterSystems's Terminal but not working in the BPL process.

I have created $zf  commands to encrypt/decrypt a file using GNUpg which is working fine in Terminal but not populating output file when I call this from BPL process. Any help would be appreciated!!

Comments

Eduard Lebedyuk · Nov 9, 2020

Terminal works under your OS user, BPL works under InterSystems user (typically irisusr).

This type of error is often caused by:

  1. IRIS OS user does not have permissions to access the input and/or output file
  2. IRIS OS user does not have required executables in PATH
  3. IRIS OS user does not have required shared libraries in LD_LIBRARY_PATH

To solve issue (1) create input and output files in IRIS Temp directory - a path returned by:

write ##class(%File).NormalizeDirectory(##class(%SYS.System).TempDirectory())

To test for issues (2) and (3) add a $zf call which inits all your dependencies and returns version or some other trivia.

To adjust PATH and LD_LIBRARY_PATH use System Management Portal. Here's some info.

I recommend checking environment variables from inside your process with:

write $SYSTEM.Util.GetEnviron(Name)

For quick testing you can adjust environment variables for the current process with this community utiliy.

0