Displaying 1 result from an estimated 1 matches for "unknown_command".
2003 May 30
1
How to check if a pipe was successfully opened or not?
Is there a way to detect if the opening of a connection to a pipe was
successful or not? Here are two examples
# Works
> con <- pipe("ls")
> res <- open(con, open="r")
> print(res)
NULL
# Does not work
> con <- pipe("unknown_command")
> res <- open(con, open="r")
> 'unknown_command' is not recognized as an internal or external
command,
operable program or batch file.
> print(res)
NULL
Can I make my script recognize/detect that the latter failed? try() will
not catch the error. The error...