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

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

[Octave-bug-tracker] [bug #57830] rmdir and other file functions should


From: Rik
Subject: [Octave-bug-tracker] [bug #57830] rmdir and other file functions should not return status unless nargout > 1
Date: Sun, 16 Feb 2020 17:33:08 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #2, bug #57830 (project octave):

For functions which always return a value, and their status and error message
are simply opional argout, it isn't necessary to throw an error.  In that
case, the returned value is either the requested information, or a null string
or other "bad" value, so the exit status of the operation is always
communicated.

For example, for waitpid,


If the returned value of PID is greater than 0, it is the process
ID of the child process that exited.  If an error occurs, PID will
be less than zero and MSG will contain a system-dependent error
message.  The value of STATUS contains additional system-dependent
information about the subprocess that exited.


But, you're right that these three functions should behave similarly


copyfile
movefile
fileattrib


Of the last three, 'exec' is just weird and probably doesn't need special
treatment.


If successful, 'exec' does not return.  If 'exec' does return, ERR
will be nonzero, and MSG will contain a system-dependent error
message.


Most of the time, there will never be an exit status.  If it does return, that
implies there was an error.  Maybe that means we shouldn't even bother to
return status since it is redundant with continuing execution of the m-file,
but I don't think we need to be too worry too much here.  'exec' isn't a
Matlab function so we can do what we want, and I don' think this gets much use
anyways.

I do agree that


fcntl
kill


seem like they should base their behavior on nargout.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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