bugGNU Octave - Bugs: bug #41278, "edit myFunction.m" does...


bug #41278: "edit myFunction.m" does not work when it's read-only

Submitted by:  None
Submitted on:  Sun 19 Jan 2014 01:50:41 PM UTC  
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Need Info Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
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.


( Jump to the original submission)

Thu 15 Dec 2016 11:04:37 AM UTC, comment #6:

In Octave 4.2.0 this behavior is still present.

The default setting for edit editinplace is still 'false'.

Hartmut <hardy>
Sat 04 Apr 2015 06:52:14 PM UTC, comment #5:

(continuing discussion from duplicate bug report #44720)

I agree that setting editinplace to true would be a sensible default.

Also, when editinplace is false, I think that a warning should be issued if the "home" directory doesn't exist. Perhaps copying to /tmp in this case would make sense?

Finally, I find it rather disturbing that the documentation of edit first refers to a directory named HOME (upper case), and then to home (lower case). I first thought this "HOME" had something to do with the environment variabe $HOME. But it doesn't.

Julien Bect <jbect>
Sun 19 Jan 2014 06:00:16 PM UTC, comment #4:

I think many people have set "edit home ." and "edit editinplace 1". Maybe this bug report would be a good place to make the argument to set those to the default, and deprecate or hide the old behavior of copying files to a home directory for local editing? This would more closely match the functionality of the Matlab editor I think.

Mike Miller <mtmiller>
Project Administrator
Sun 19 Jan 2014 05:53:33 PM UTC, comment #3:

Mike, you are right. All three possibilities are working.
I had the octave folder some time ago but have installed the system on a new hardware where the folder is still missing.

Torsten <ttl>
Project Member
Sun 19 Jan 2014 05:41:23 PM UTC, comment #2:

Torsten, do you get the error you are seeing if you create the directory /home/ttl/octave first?

The behavior here is that edit tries to open the file read-write. If that fails, it tries to copy the file into your "edit home" directory, which is ~/octave by default. The error you are seeing is the same error I see when that directory doesn't exist. If you set "edit home" to another existing directory, or mkdir ~/octave first, does it work?

Alternatively, set the "edit editinplace" option to true, then it will open read-only files without trying to copy them.

Mike Miller <mtmiller>
Project Administrator
Sun 19 Jan 2014 04:53:30 PM UTC, comment #1:

Confirmed on Linux:

when foo.m is readonly.

Torsten <ttl>
Project Member
Sun 19 Jan 2014 01:50:41 PM UTC, original submission:

Suppose I have
and make it read-only.
then I execute:
This will fail. Octave will ask me to create the file, but that will also fail. I looked around I think the reason is the following line 318-319 in edit.m:

At this point the variables are as follows:
However, the directory D:UsersmyUserNameoctaveTemp does not exist, and "cp.exe -r" does not seem to create the directory, and therefore fails.
The cp.exe is used, because it is located in the path under Octave-3.8.0bin/cp.exe (given my version of http://octave.osuv.de/3.8/windows/octave-3.8.0-1-installer.exe).

I also patched the copyfile.m to always use the xcopy command on windows, but then the GUI will freeze because in this case, xcopy waits for user input on question if destination is file or directory (this is not visible to the user).

As a result, I can't open read-only file in the GUI from the command prompt.



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

Attach Files:

No files currently attached


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by jbect (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by ttl (Posted a comment)

    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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-27 mtmiller Release3.8.0 => dev
    2015-07-02 mtmiller Dependencies- => bugs #45422 is dependent
    2015-04-04 rik5 Dependencies- => bugs #44720 is dependent
    2014-01-19 mtmiller CategoryGUI => Octave Function
    2014-01-19 mtmiller StatusConfirmed => Need Info
    2014-01-19 ttl StatusNone => Confirmed
        Operating SystemMicrosoft Windows => Any

    Back to the top

    Powered by Savane 3.3