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/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned 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
  • -unavailable- added by rmottola (Updated the item)
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by snej (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 15 Jan 2013 10:23:05 PM UTCrmottolaOpen/ClosedIn Test=>Closed
    Fri 10 Aug 2012 09:26:31 AM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>In Test

    Back to the top


    Powered by Savane 3.1-cleanup1