I want to execute svn delete
from my Grails application. In the Grails console, I tested both versions:
"svn delete /usr/share/mydir".execute() Runtime.getRuntime().exec("svn delete /usr/share/mydir")
In both cases, an instance of java.lang.Process
returned, but the command is not executed ( /usr/share/mydir
not deleted).
This behavior is only observed when running the application on Linux (Ubuntu). If I run it on Windows, the command will be executed.
Update
Following Timβs advice in the comments, I changed the command so that it captures the output of the process:
def process = "svn delete /usr/share/mydir".execute() def out = new StringBuilder() process.waitForProcessOutput(out, new StringBuilder()) println "$out"
Now I see that the reason for his failure is that:
Svn error: Cannot open file '/usr/share/mydir/.svn/lock': Permission denied
source share