bugGNU Octave - Bugs: bug #57799, mkdir always return status output

 
 

bug #57799: mkdir always return status output

Submitted by:  Guillaume <gyom>
Submitted on:  Wed 12 Feb 2020 11:21:35 AM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  Closed
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)

Sun 16 Feb 2020 06:17:54 PM UTC, comment #6: 

I have filed a new bug report about the large number of file-related functions which need to change behavior based on whether nargout == 0.  See bug #57830.

I have moved rmdir to that bug report.  This bug report, now only for mkdir(), has been resolved so I closing it.

Rik <rik5>
Project Administrator
Fri 14 Feb 2020 05:59:48 PM UTC, comment #5: 

I pushed a fix for mkdir here: https://hg.savannah.gnu.org/hgweb/octave/rev/4563c23597dd.

The change for rmdir is also simple, but it upset BIST tests and functionality in more than 20 m-files.  I have it ready, but I think the 6.0 code should be merged to stable, before this disruptive development goes on.  I will ask about this on the Maintainer's list.

Rik <rik5>
Project Administrator
Thu 13 Feb 2020 02:41:10 AM UTC, comment #4: 

This is what I get for Matlab R2019a:

>> cd

/home/siko1056

>> mkdir some_dir
>> rmdir some_dir
>> cd /usr/bin/
>> mkdir some_dir
Error using mkdir
Permission denied

>> rmdir some_dir
Error using rmdir
/usr/bin/some_dir is not a directory.

Kai Torben Ohlhus <siko1056>
Project Member
Thu 13 Feb 2020 01:10:13 AM UTC, comment #3: 

What does Matlab do if no output is requested, but the attempt fails?  For example, you try to make a directory in a location where you do not have write permission.  Does it throw a warning or an error, or is it silent about the failure?

Rik <rik5>
Project Administrator
Wed 12 Feb 2020 10:01:12 PM UTC, comment #2: 

From the Matlab docs, 'mkdir' and 'rmdir' should return nothing with nargout == 0. If an error occurs that would have returned a status of 0, that should raise an error instead.

Mike Miller <mtmiller>
Project Administrator
Wed 12 Feb 2020 12:34:37 PM UTC, comment #1: 

The same applies for rmdir:

octave:1> version
ans = 5.2.1
octave:2> mkdir zz
ans = 1
octave:3> rmdir zz
ans = 1
octave:4>

A.R. Burgers <arb>
Wed 12 Feb 2020 11:21:35 AM UTC, original submission:  

A very minor issue but mkdir always return status as output even when no output variable was specified:

>> mkdir ("foo")
ans = 1

while Matlab doesn't.

Not sure what is the preferred way to fix this, one being:

[sts, msg, msgid] = mkdir_recur (parent, [dirname, ext]);
if (nargout)
  status = sts;
endif

Guillaume <gyom>

 

(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

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by arb (Posted a comment)
  • -email is unavailable- added by gyom (Submitted the item)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2020-02-16 rik5 StatusIn Progress => Fixed
        Open/ClosedOpen => Closed
        Summarymkdir and rmdir always return status output => mkdir always return status output
    2020-02-14 rik5 StatusConfirmed => In Progress
    2020-02-13 mtmiller StatusNeed Info => Confirmed
        Summarymkdir always returns its first output => mkdir and rmdir always return status output
    2020-02-13 rik5 StatusConfirmed => Need Info
        Summarymkdir and rmdir always return status output => mkdir always returns its first output
    2020-02-12 mtmiller StatusNone => Confirmed
        Summarymkdir always returns its first output => mkdir and rmdir always return status output

    Back to the top


    Powered by Savane 3.5