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

 
 

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

Submitted by:  Mike Miller <mtmiller>
Submitted on:  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

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project Administrator
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>
Project Administrator

 

(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

 

Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

Only project members can vote.

 

 

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2019-01-06 mtmiller Dependencies- => bugs #55406 is dependent
2019-01-06 mtmiller Carbon-CopyRemoved 80942 => -

Back to the top


Powered by Savane 3.4