octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MSVC compiler support [patch 32]: ls


From: Michael Goffioul
Subject: Re: MSVC compiler support [patch 32]: ls
Date: Fri, 27 Oct 2006 23:20:45 +0200
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

John W. Eaton a écrit :
I decided to make ls a script file function instead of a built-in
function, and to let the user specify the command to use with a
separate new function called ls_command.  For example,

  old_cmd = ls_command ("/my/ls");

returns the previous command in old_cmd and sets the internal variable
to "/my/ls" and

  curr_cmd = ls_command ();

returns the current command to use.  The default value is set by this
code:

  if (isempty (__ls_command__))
    ## FIXME -- ispc and isunix both return true for Cygwin.  Should they?
    if (ispc () && ! isunix () && isempty (file_in_path (EXEC_PATH, "ls")))
      __ls_command__ = "cmd /C dir /w";
    else
      __ls_command__ = "ls -C";
    endif
  endif

Is it OK to use /w?  As I recall, that is the switch that causes DIR
to print output in columns.  I think we should do that to match the
way output is displayed by "ls -C".

"/D" is better as it will sort items in columns and not in rows. This looks more like the UNIX-way.

Is it reasonable to check EXEC_PATH to see whether we have a real ls
command available?  That way, I won't be annoyed if I start up the
Windows version of Octave and type "ls -l" (assuming I have ls in my
PATH, I think this should work).

It seems reasonable.

Michael.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]