octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #55401] provide a documented function that ret


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #55401] provide a documented function that returns the OS executable suffix string
Date: Sat, 5 Jan 2019 21:19:54 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?55401>

                 Summary: provide a documented function that returns the OS
executable suffix string
                 Project: GNU Octave
            Submitted by: mtmiller
            Submitted on: Sat 05 Jan 2019 06:19:52 PM PST
                Category: Interpreter
                Severity: 1 - Wish
                Priority: 5 - Normal
              Item Group: Feature Request
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

Please provide a function that users and third-party packages can rely on
inside of Octave to get the suffix / file extension for executable programs.

For example, on Unix and GNU/Linux operating systems this would return the
empty string, and on Windows this would return '.exe'.

Inside of Octave, m-file functions use


ext = __octave_config_info__ ("EXEEXT");


This works fine for Octave itself, but is not a function that should be relied
on for code outside of Octave. So Octave should provide an equivalent that can
be used safely.

As a motivating example, the Octave Forge package 'miscellaneous' shells out
to the program 'units'. It has a check that the executable 'units' exists in
PATH, but it has to append EXEEXT to ensure that it works on Windows.


function fpath = check_units ()
  ## See bug #38270 about why we're checking this way.
  fpath = file_in_path (getenv ("PATH"), sprintf ("units%s",
octave_config_info ("EXEEXT")));
  if (isempty (fpath))
    error ("units: %s\nVerify that GNU units is installed in the current
path.",
           rawoutput);
  endif
endfunction





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55401>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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