[Scilab-users] Problem with dos function

arctica1963 arctica1963 at gmail.com
Fri Dec 18 23:39:07 CET 2020


Hello Samuel,

Yes I did try the powershell option and it is the same response, the program
runs (boolean result is true) but the result is not resolved in the output.

The external program is using GMT (Generic mapping tools) and so that needs
to be installed to test this issue.

I also installed 5.4.1 to check and that also gives the same problem.

I checked the function in Octave (5.1.0) which looks the same as Scilab and
it gives the proper result:
https://octave.sourceforge.io/octave/function/dos.html

>> dos('grdinfo crop1.grd')
crop1.grd: Title: Grid computed with Mirone
crop1.grd: Command:
crop1.grd: Remark: File written from Matlab
crop1.grd: Gridline node registration used [Geographic grid]
crop1.grd: Grid file format: nf = GMT netCDF format (32-bit float), CF-1.7
crop1.grd: x_min: 1.05833333333 x_max: 5.14166666667 x_inc: 0.0166666666667
(1 min) name: longitude n_columns: 24
6
crop1.grd: y_min: 3.84166666667 y_max: 7.90833333333 y_inc: 0.0166666666667
(1 min) name: latitude n_rows: 245
crop1.grd: z_min: -106.033233643 z_max: 131.578842163 name: z [unknown]
crop1.grd: scale_factor: 1 add_offset: 0
crop1.grd: format: netCDF-4 chunk_size: 246,245 shuffle: on deflation_level:
8

ans = 0

I have looked at the Octave file, but it uses a "system" function which is
not the same in Scilab:

function [status, text] = dos (command, echo_arg)

  if (nargin < 1 || nargin > 2)
    print_usage ();
  endif

  status = 1;
  text = "";

  ## FIXME: Should this be ispc ()?  There may be an issue with MinGW
  if (! isunix ())
    [status, text] = system (command);
    if (nargin > 1 || nargout == 0)
      printf ("%s\n", text);
    endif
  endif

endfunction

Where is the dos function in Scilab? 

Not sure if it is relevant, but testing on Windows 8.

Lester



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html



More information about the users mailing list