bugGNU Octave - Bugs: bug #47818, Octave

 
 

bug #47818: Octave

Submitted by:  Ezequiel Gaona <snd>
Submitted on:  Sun 01 May 2016 07:00:53 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: DuplicateAssigned to: None
Originator Name: SnDOpen/Closed: Closed
Release: 4.0.1Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 02 May 2016 01:18:03 AM UTC, comment #3:

This is basically bug #31080, which was reported a long time ago and has a lot more discussion on it, so I'm going to close this as a duplicate, but please add your comments there.

The root problem is probably related to the directory timestamp, and ignore_function_time_stamp only operates on known function files, not new ones.

Mike Miller <mtmiller>
Project Administrator
Sun 01 May 2016 07:05:11 PM UTC, comment #2:

A workaround that works:

addpath("C:\example)
fid = fopen ("C:\example\foo.m", "wt");
fputs (fid, "function foo ()\n disp (\"This is function foo.\");\nendfunction\n");
fclose (fid);
addpath("C:\example)
fn = str2func ("foo");
fn ()

Ezequiel Gaona <snd>
Sun 01 May 2016 07:01:38 PM UTC, comment #1:

ups... forgot to fill the title :S

Ezequiel Gaona <snd>
Sun 01 May 2016 07:00:53 PM UTC, original submission:

This works:

fid = fopen ("foo.m", "wt");
fputs (fid, "function foo ()\n disp (\"This is function foo.\");\nendfunction\n");
fclose (fid);
fn = str2func ("foo");
fn ()

This doesn't:

addpath("C:\example)
fid = fopen ("C:\example\foo.m", "wt");
fputs (fid, "function foo ()\n disp (\"This is function foo.\");\nendfunction\n");
fclose (fid);
fn = str2func ("foo");
fn ()

That is because Octave doesn't refresh the functions in others directories, only the current path.

This is something that rehash would fix... right?

This fails too:

fid = fopen ("foo.m", "wt");
fputs (fid, "function foo ()\n disp (\"This is function foo.\");\nendfunction\n");
fclose (fid);
rehash()
fn = str2func ("foo");
fn ()

Using ignore_function_time_stamp doesn't fix it:

ignore_function_time_stamp("none")
fid = fopen ("foo.m", "wt");
fputs (fid, "function foo ()\n disp (\"This is function foo.\");\nendfunction\n");
fclose (fid);
fn = str2func ("foo");
fn ()

If I wait a while (like 1 min or something like that), I can do the str2func and works fine.

(Windows, no packages installed, octave 4 clean)

Maybe #35771 is related.

Ezequiel Gaona <snd>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by snd (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 02 May 2016 01:18:45 AM UTCmtmillerDependencies-=>Depends on bugs #31080
    Mon 02 May 2016 01:18:18 AM UTCmtmillerDependencies-=>Depends on bugs #35771
    Mon 02 May 2016 01:18:03 AM UTCmtmillerStatusNone=>Duplicate
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1