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

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

[Octave-bug-tracker] [bug #65548] Every time a new function is created i


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #65548] Every time a new function is created in a separate m-file, an 'undefined' error message is displayed
Date: Wed, 3 Apr 2024 03:24:21 -0400 (EDT)

Follow-up Comment #1, bug #65548 (group octave):

IIRC, Octave checks the last-modified time-stamp of folders in the load path
when some conditions occur (e.g., the command prompt is displayed or the user
changes the current directory). If this time-stamp updated since the last
check, the containing files are rehashed.

It might be that none of those triggering conditions are reached when you
programmatically create new m-files and try to execute them immediately. 
It might also be that one of those triggering conditions *is* reached. But the
last-modified time-stamp didn't update yet. (Windows is known to have a poor
time-stamp resolution. It's also known that it doesn't correctly update
time-stamps at all, e.g., on some shared file systems.)

It is hard to guess what is causing the particular issue that you are seeing
as long as you don't provide any code that reproduces the issue for you. Could
you please upload a minimum example that reproduces the issue?

Alternatively to relying on one of the "automatic triggers" for re-hashing the
load path, you could try to manually trigger a rehash by calling the function
`rehash()` after you created the new .m files.
Depending on the speed of file operations on your system, you might need to
wait a bit after the file creation for it to be actually visible (e.g., using
pause). (The latter might explain why you are seeing the issue in some
versions of Octave but not in others: Maybe, some timings have changed?)



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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