bugGNUstep - Bugs: bug #35672, -[NSFileManager...


You are not allowed to post comments on this tracker with your current authentication level.

bug #35672: -[NSFileManager createDirectoryAtPath:attributes:] should not create intermediate dirs

Submitted by:  Jens Alfke <snej>
Submitted on:  Wed 29 Feb 2012 08:16:23 PM UTC  
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Fri 10 Aug 2012 09:26:31 AM UTC, comment #1: 

Changed in svn trunk

Richard Frith-Macdonald <CaS>
Project Member
Wed 29 Feb 2012 08:16:23 PM UTC, original submission:  

The GNUstep implementation of -[NSFileManager createDirectoryAtPath:attributes:] creates intermediate directories in the path if they don't exist; e.g. if called on @"/tmp/foo/bar/baz" it will create directories "foo" and "bar" if they don't exist, instead of failing.

This contradicts the documented and actual behavior of Apple's implementation in the Foundation framework. The docs for that method state "The directory to be created must not yet exist, but its parent directory must exist." I know from experience that this is the actual behavior.

A fringe benefit of fixing this is that the implementation of the method looks like it will get a lot simpler :)

A side effect is that -[NSFileManager createDirectoryAtPath: withIntermediateDirectories: attributes: error:] will create intermediate directories even if the corresponding parameter is NO, because it in that case it calls into the older version of the method.

Jens Alfke <snej>


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 rmottola (Updated the item)
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by snej (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 logged-in users can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-01-15 rmottola Open/ClosedIn Test => Closed
    2012-08-10 CaS StatusNone => Fixed
        Open/ClosedOpen => In Test

    Back to the top

    Powered by Savane 3.5