Using $ZF(-100) on Caché
Until now i used $ZF(-1), in older Caché versión, now I try to use $ZF(-100), i do:
REST>w $ZV Cache for Windows (x86-64) 2018.1.4 (Build 505_1) Thu May 28 2020 10:12:49 EDT REST>s a=$zf(-100,"/SHELL","dir") S a=$ZF(-100,"/SHELL","dir") ^ <NOTOPEN>
What is wrong?
Thanks in advance
Comments
The issue you're encountering with $ZF(-100) and the <NOTOPEN> error likely stems from the use of the "/SHELL" flag. For $ZF(-100) to execute commands with this flag, it may encounter file access issues or problems with setup for standard input/output redirection. Specifically, the <NOTOPEN> error can occur if:
- A file specified for input/output redirection cannot be created or opened.
- The command cannot be started as requested.
Ensure the following:
- Verify that there are no issues with permissions or availability for any file or resource specified with
/STDIN,/STDOUT, or/STDERRflags. These flags control input/output redirection [1]. - When invoking the shell with
/SHELL, ensure that the OS command's path is accessible, and there are no syntax errors in the options [1][2]. - Avoid mixing syntax such as redirection operators
>>with/STDOUTflags as they might create conflicts [3].
You can resolve this error by ensuring:
- Necessary permissions are granted to create or open files for redirection.
- The command and its arguments are validated properly without conflicting flags or operators.
- Avoid redundant configurations like using
/STDOUTflags along with output redirection operators in the command.
For example, to execute a common Windows directory listing command with redirection, use:
set status = $ZF(-100, "/SHELL", "dir", "")
w !,"Status: ", status
Ensure you do not accidentally specify both /STDOUT redirection and shell redirection (>> inside the command). Adjust based on the exact use case and configuration [1][3].
Sources:
Same command works fine for me, similar vintage of Ensemble. Must be something specific to your environment/machine, and what drives are available. You could try
set sc = $ZF(-100, "/SHELL","dir","C:\")
or some other drive you know to be present, and see whether that makes a difference.
.png)
If this is just for a quick/dirty directory listing from terminal, you can also use !, exclamaiton mark, this runs the host OS terminal, you can then run any OS commands that you need to.
Once you are done, just type EXIT (On Windows) and you will be back to your IRIS terminal session.
.png)
Thanks a lot, it was a issue with privileges