diff src/dirfns.cc @ 14679:a543ed02e673

Allow the builtin function mkdir to create missing parent directories * bootstrap.conf : Add the mkdir-p and savewd gnulib modules. * file-ops.cc (static int make_ancestor (const char*, const char*, void*)): New function. (int octave_mkdir (const std::string&, mode_t, std::string&, bool): Add fourth argument and use it to conditionally select whether to make the missing parent directories. * file-ops.h (int octave_mkdir (const std::string&, mode_t, std::string&, bool): Add fourth argument. * lo-cutils.c (struct mkdir_options): New structure (static void announce_mkdir (const char*, void*), static int process_dir (char *, struct savewd *, void *), int octave_mkdir_parents (const char *, mode_t, int (*make_ancestor) (const char *, const char *, void *)): New functions. * lo-cutils.h (int octave_mkdir_parents (const char *, mode_t, int (*make_ancestor) (const char *, const char *, void *)): New function. * dirfns.cc (Fmkdir): Call octave_mkdir with the make_parents argument set to true.
author David Bateman <dbateman@free.fr>
date Wed, 23 May 2012 22:34:37 +0200
parents eff4a5933e28
children 0ab3dd0fad18
line wrap: on
line diff
--- a/src/dirfns.cc	Wed May 23 13:36:24 2012 -0400
+++ b/src/dirfns.cc	Wed May 23 22:34:37 2012 +0200
@@ -271,7 +271,7 @@
         }
       else
         {
-          int status = octave_mkdir (dirname, 0777, msg);
+          int status = octave_mkdir (dirname, 0777, msg, true);
 
           if (status < 0)
             {