[bug #68243] copyfile does not create nested destination

Ray Zimmerman <[email protected]>
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
Please use the bug tracker to post updates to a bug report.  The mailing list is intended as a read-only notification stream.  Info posted to this mailing list address won't appear in the tracker database where it is most useful.

URL:
  <https://savannah.gnu.org/bugs/?68243>

                 Summary: copyfile does not create nested destination
                   Group: GNU Octave
               Submitter: rdzman
               Submitted: Tue 14 Apr 2026 05:28:11 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name:
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Unlocked
                 Release: 11.1.0
        Operating System: Microsoft Windows
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 14 Apr 2026 05:28:11 PM UTC By: Ray Zimmerman <rdzman>
In MATLAB, when using copyfile() to copy a folder to a destination folder that
does not yet exist, the destination folder is created, including multiple
levels of folders needed to create the full destination path.

Octave, on the other hand, will only do it if it is a single folder creation
that is required.

E.g. Suppose your current working directory contains only folderA ...

In MATLAB ...

copyfile('folderA', 'folderB/folderC')

... will create both folderB and folderC, but in Octave it gives the error:

error: copyfile: operation failed: cp: cannot create directory
'folderB/folderC': No such file or directory


On the other hand, Octave creates folderC just fine if folderB already
exists.









    _______________________________________________________

Reply to this item at:

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

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCad55LgAKCRCqLAuaBUf3
TjL/AQD6lmlUyXZnk3wha5AqohCVDvg0s5LVJC6QEQkKIXoXbwD+KhR4xF3qenjs
0/oYdlVbTlxrppqqQk/qvLRYjGCS0Ag=
=AShH
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.