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

Group
 
 

bug #32899: [NSFileManager createDirectoryAtPath:withIntermediateDirectories:attributes:error:] creates directories incorrectly

Submitter:  Chris Armstrong <carmstrong>
Submitted:  Thu 24 Mar 2011 12:21:53 PM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  In Test
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 07 Apr 2011 05:15:45 AM UTC, comment #1: 

Thanks ... I applied that patch.  Great to have a testcase includeed.

Richard Frith-Macdonald <CaS>
Group Member
Thu 24 Mar 2011 12:21:53 PM UTC, original submission:  

The method in the summary does not create directories correctly when withIntermediateDirectories == NO. In this case, it creates the last path component in the current directory, which is the wrong behaviour. Please refer to:

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/doc/uid/20000305-SW5

I've created a patch that fixes this so it will create the right directory, but only under the correct circumstances. I've also added a test case for it too.

Note that I do not use -createDirectoryAtPath:attributes: because it is implemented to create intermediate directories (even though it shouldn't).

Chris Armstrong <carmstrong>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #23005:  gnustep-base-NSFileManager-withIntermediateDirectories-fix.patch added by carmstrong (2KiB - application/octet-stream - Patch to implement correctly + added test cases)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by carmstrong (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
    2011-04-07 CaS StatusNone Fixed
        Open/ClosedOpen In Test
    2011-03-24 carmstrong Attached File- Added gnustep-base-NSFileManager-withIntermediateDirectories-fix.patch, #23005

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code