Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.1.3, 2.2.3, 2.3.4, 2.4.6, 3.0.0
-
None
Description
Currently, we run the command to check the existence. This is dangerous and doesn't work sometimes.
scala> sys.process.Process("cat").run().exitValue() res0: Int = 0 scala> sys.process.Process("ls").run().exitValue() LICENSE NOTICE bin doc lib man res1: Int = 0 scala> sys.process.Process("rm").run().exitValue() usage: rm [-f | -i] [-dPRrvW] file ... unlink file res4: Int = 64
scala> sys.process.Process("command -v rm").run().exitValue() /bin/rm res5: Int = 0