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

Group
 
 

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

Submitter:  Jens Alfke <snej>
Submitted:  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
* Mandatory Fields

Add a New Comment Rich Markup
   

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

Changed in svn trunk

Richard Frith-Macdonald <CaS>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    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.13-f8d8.
    Corresponding source code