Sat 14 May 2016 01:45:03 AM UTC, comment #14:
I cleaned up the cset significantly and checked it in here (http://hg.savannah.gnu.org/hgweb/octave/rev/b8c05cc524ef).
Fixed, after only 5.5 years!
|
Sun 01 May 2016 12:40:56 PM UTC, comment #13:
The previous patch had a few bugs. This version should be ready. (Famous last words...)
It has renamed the built-in to _mkdir_ so as not to conflict with the script. A typo in the documentation has been fixed. The script has been added to modules.mk.
(file #37036)
|
Wed 10 Feb 2016 03:39:22 AM UTC, comment #12:
Carnë, the code you posted looks simple. Why is it "definitely not an appropriate fix for Octave"? Since this bug is over 5 years old, I think it would be better to have your kludge in than not have the functionality.
The attached changeset has a bit of a preamble to handle the case of a single parameter. It is perhaps messy to have a script with the same name as a built-in, but that could easily be fixed by renaming the built-in.
(file #36286)
|
Fri 30 Nov 2012 07:43:47 AM UTC, comment #11:
Upps. There was a mistake on the code I just posted:
|
Fri 30 Nov 2012 07:40:08 AM UTC, comment #10:
I just had this problem with kakila when working on pkg. The following can be a temporary fix for someone who stumbles upon this. It is definitely not an appropriate fix for Octave:
|
Thu 07 Jun 2012 11:03:31 PM UTC, comment #9:
I backed out two changesets related to this bug (see the following commits linked below) because there are some problems with using the gnulib mkdir-p module with MSVC and the problems that Rik noticed and (I failed to fix, see the patch that I attached to the bug report) are still not fixed. So I think it would be better to wait until the gnulib problems are addressed and we understand how to use the mkdir-p module correctly to do exactly what mkdir does but for a directory tree instead of a single directory. You'd think this would be a simple problem...
http://hg.savannah.gnu.org/hgweb/octave/rev/7e198fe3732c
http://hg.savannah.gnu.org/hgweb/octave/rev/0ab3dd0fad18
|
Mon 28 May 2012 04:44:18 PM UTC, comment #8:
The changing of pwd by mkdir stops the 'make check' target from working. I have committed a very temporary fix here (http://hg.savannah.gnu.org/hgweb/octave/rev/c2411bff11c6) until 'mkdir -p' is sorted out.
|
Thu 24 May 2012 06:36:42 PM UTC, comment #7:
I reopened this report in response to Rik's comments.
I also tried fixing the problems, but I just don't understand how the gnulib mkdir-p thing is supposed to work, and I don't have time to work on this now.
I've attached my attempt below. This seems to solve the umask problem in some cases, but not all. With my changes, it fails for things like
mkdir ("/tmp/foo/bar")
if only /tmp exists.
I recommend looking at the coreutils mkdir program to see how this gnulib module is supposed to be used.
Unfortunately, the gnulib code seems to be written with the idea that printing error messages is ok. Or maybe there is some way to disable that with the gnulib error module that I don't know about. We need to have Octave in control of printing error messages, not gnulib.
(file #25916)
|
Thu 24 May 2012 01:31:26 AM UTC, comment #6:
I just checked the new code and I found some incompatibilities between 3.6.1 and the development code.
Issue #1 : umask not respected
On Linux Kubuntu 10.04, the following code produces different results under 3.6.1 and the development tip.
Under 3.6.1, 'ls -ld tmp1' shows
d---------
Under dev tip it shows
drwxrwxrwx
Issue #2 : pwd is changed by mkdir
This does not occur with 3.6.1.
|
Wed 23 May 2012 08:39:58 PM UTC, comment #5:
Ok I pushed a version that copies the data in the changeset
http://hg.savannah.gnu.org/hgweb/octave/rev/a543ed02e673
As for my question about the inclusion of mkdir-p.h, my ugly means of including the headers was a hangover from the fact that I initially didn't include these gnulib modules in bootstrap.conf. As the headers are copies to libgnu/ I don't need to include the path in the include statement
D.
|
Wed 23 May 2012 07:02:01 PM UTC, comment #4:
Looking at the current version of savewd_process_files, it seems that there should be const and non-const versions of this function, but this is C, so...
Your action functon won't write to the non-const string, but even so, I don't really like casting away const so I'd say make a copy.
|
Wed 23 May 2012 11:24:11 AM UTC, comment #3:
I propose the attached changeset. However there are two things I don't like about 1
1) The manner in which mkdir-p.h and savewd.h are included in lo-cutils.c. What is the recommended manner to do this?
2) in octave_mkdir_parents the argument "dir" drops the const qualifier when being assigned to argv[0]. Should I make a copy instead?
Any particular recommendations or should I commit this changeset as is?
D.
(file #25910)
|
Sun 29 Aug 2010 02:36:54 PM UTC, comment #2:
Using the gnulib mkdir_p module seems like a good solution. It would be helpful if someone would prepare a changeset to add this feature.
|
Wed 04 Aug 2010 10:44:42 PM UTC, comment #1:
Making this change would make Octave more Matlab compatible as the Matlab function already attempts to create directories which don't exist. See the remarks section of
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/mkdir.html
Realistically, it shouldn't be that difficult to implement. Octave pulls the mkdir function from gnulib for portability reasons. Gnulib already has a mkdir module which implements 'mkdir -p' and creates the necessary intervening directories. See a description of the module at:
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=modules/mkdir-p
|
Wed 04 Aug 2010 06:42:17 PM UTC, original submission:
Currently mkdir fails if given intermediate directories such that it would be necessary to create a hierarchy. This is NOT conformable to M*, and it would be useful to have this feature (see below for a discussion). JWE has also said he would consider a patch.
http://octave.1599824.n4.nabble.com/recursive-mkdir-DIR-s-mylib-mkdir-DIR-s-td1629148.html
|