Executing mount command from java / Child Shell cannot access the mounted directories -


I have a dragon script, which needs to be executed with a Java code. I use the following command:

  ScriptResult Results = Executor. ExecuteCommand (script, params.getParams (), incorrect);   

But the executor. executeCommand () A new shell fork I had previously run a mount command and the contents of / mnt / folder1 are accessible from the parent shawl but are not available from the new ignored hair shell.

  string cmd = new string ("/ bin / mount ")  

I have tried to execute the mount command, just before the executor. Process P = New Processor Builder (CMD). Start ();

and

  string to executeCommand () Ip: / folder1 / mnt / folder1 " CMD = new string ("mount"); string [] arg = new string [] {"ip: / folder1," / mnt / folder1 "}; Process RR = Runtime.Greatantum (). Exec (cmd); Both give the following error:  
  java.io.IOException: "mount ip: / folder1 / mnt / folder1" did not run the program Can be: error = 2, by processing manufacturer by no such file or directory is not on java.lang. Start (ProcessBuilder.java:1041): java.io.IOEException: Error = 2, there is no such file or directory   

I have created a myscript sh And mount command and python script copied the order to myscript. I implemented myscript throgh java code and it was successful, but I should add the mount command to the Java code and not through the different script.

Try changing

  string cmd = new string (" / Bin / mount ip: / folder1 / mnt / folder1 "); Process P = New Process Builder (CMD) Start ();   

to

  Saint Ring [] CMD = new string [] {"/ bin / mount", "ip: / folder1", "/ mnt / Folder1 "}; Process P = New Process Builder (CMD) Start ();    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -