bugGNU Octave - Bugs: bug #55401, provide a documented function that...

 
 

bug #55401: provide a documented function that returns the OS executable suffix string (EXEEXT)

Submitter:  Mike Miller <mtmiller>
Submitted:  Sun 06 Jan 2019 02:19:52 AM UTC
   
 
Category:  Interpreter Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 06 Jan 2019 02:28:46 AM UTC, comment #1: 

In Python for example, one can use


sysconfig.get_config_var("EXE")


Alternatively, if we can't come to an agreement on whether this is a good idea or how to provide this function to users reliably, maybe we can at least provide some boilerplate code that users can paste to check for a program with or without a file extension at run time.

Mike Miller <mtmiller>
Group Member
Sun 06 Jan 2019 02:19:52 AM UTC, original submission:  

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


Mike Miller <mtmiller>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only group members can vote.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2019-10-16 mtmiller Summaryprovide a documented function that returns the OS executable suffix string provide a documented function that returns the OS executable suffix string (EXEEXT)
2019-01-06 mtmiller Dependencies- bugs #55406 is dependent
2019-01-06 mtmiller Carbon-CopyRemoved 80942 -

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code