Can anyone explain this.
The command OS-COMMAND SILENT VALUE("xcopy c:\a.txt d:\ /Y") will do nothing if there is an OUTPUT TO "somefile" before it (this could also be a named stream - e.g. OUTPUT STREAM st1 TO "somefile"). However, if no outputs then xcopy works ok.
What is going on here!?
Notes:
Adding OUTPUT TO TERMINAL immediately before the xcopy and it works, irrespective of how many other streams are already redirecting to files.
The xcopy command is fine in itself - tested thoroughly.
OS-COMMAND SILENT VALUE("copy c:\a.txt d:\ /Y") works fine always.
No prior 'OUTPUT TO' then xcopy works fine.
I've replicated this issue in 9.1D and 11.6.
Hello Brian
Many thanks for your replies. I had tried 'cmd /c' already without success. However doing this makes it work:
OUTPUT TO TERMINAL.
OS-COMMAND SILENT VALUE("xcopy c:\a.txt d:\ /Y")
OUTPUT CLOSE.
No idea why, but happy just to get it working :-)
I was having a similar issue last month with OS-COMMAND. I was executing MOVE and DIR commands in batch mode when all of a sudden the process would just seem to hang. There would be a cmd.exe process that I couldn't get rid of without rebooting the server.
Since this was in 11.2 I used some .Net Methods to do the commands:
System.IO.Directory:GetFiles(path AS CHAR) RETURNS CLASS "System.String[]" for DIR.
System.IO.File:Move(source AS CHAR, dest AS CHAR ) for MOVE.
This seemed to do the trick though the customer claimed it was slower.
Not sure if there's an equivalent to xcopy though...
I'd love to know if this logged bug is related to my issue at all because I couldn't find any reason for it.
Hi Brian,
we had problems with I/O commands too (case 00319009 and 00287906)
Started with 10.2B and without any change of code it stopped working.
Our error was to change the OE version and windows version and the nightmare began.
Our workaround was to use "start /w ..." at the beginning and then the orginal command.
Stefan
Hi,
Another option is to put the command(s) in a batch file and run the batch file.
HTH
Stefan, I got the same issue.
In some situation I had to start or stop some databases. The command to stop worked fine ("_mprshut db -by"). But to start the database, I had to use "start _mprosrv etc", or the prowin32 just freeze.
Adriano,
you described exact our problem - the problem.
We had many open cases (for years) but finally we solved it ourselves with adding "start".
Since today nobody was able to identify the cause why the process_mprosrv is blocked and all clients (prowin, promon) freezes without using start.
But until today we have sporadic problems after reboot, we are on 11.6.3.
Stefan
i've never ran into any issues since i've moved to using batch files YMMV
for example, the baksys project in the standard libraries at oehive.org makes extensive calls to openedge command line tools using the same approach.