Hi Team, I am trying to create a simple workflow (vro 8.4 version) in which the first step is to check if there is a specific folder that exists in vro filesystem(/tmp/folder-xyz) or not If yes then create a file inside it(/tmp/folder-xyz/file1.txt). I am using the command class for this purpose.
for creating file:
cmd1 = "touch /tmp/folder-xyz/file1.txt" command = new Command(cmd1) command.execute(true)
var cmd2 = '[ -d "/tmp/folder-xyz" ] && echo "Directory /tmp/folder-xyz exists."' command = new Command(cmd2) command.execute(true)
The directory check command I want to return the above echo statement if it exists but I don't know how to do that. I have tried
The Command class is disabled by default:
For temp directory access, you want to use System.getTempDirectory() and the File class. E.g. new File(System.getTempDirectory() + "/temp.txt").exists;