bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #35672] -[NSFileManager createDirectoryAtPath:attributes:] should n


From: Jens Alfke
Subject: [bug #35672] -[NSFileManager createDirectoryAtPath:attributes:] should not create intermediate dirs
Date: Wed, 29 Feb 2012 20:16:24 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.22 (KHTML, like Gecko) Chrome/19.0.1049.3 Safari/535.22

URL:
  <http://savannah.gnu.org/bugs/?35672>

                 Summary: -[NSFileManager createDirectoryAtPath:attributes:]
should not create intermediate dirs
                 Project: GNUstep
            Submitted by: snej
            Submitted on: Wed 29 Feb 2012 08:16:23 PM GMT
                Category: Base/Foundation
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?35672>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]