• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Why would creating NSItemReplacementDirectory fail?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why would creating NSItemReplacementDirectory fail?


  • Subject: Why would creating NSItemReplacementDirectory fail?
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 24 Jun 2015 13:39:24 -0700

Anyone know what would cause NSFileManager (on OS X 10.10) to fail to create an NSItemReplacementDirectory? We’re using this call to create a temporary directory to save an intermediate file into, and it works fine on iOS and Mac … except for right now, when it’s started reliably failing on my MacBook Pro. As in, it worked this morning but now after lunch it fails every time I run our unit tests:

        NSError* error;
        NSURL* parentURL = [NSURL fileURLWithPath: _path isDirectory: YES];
        NSURL* tempDirURL = [[NSFileManager defaultManager]
                                 URLForDirectory: NSItemReplacementDirectory
                                 inDomain: NSUserDomainMask
                                 appropriateForURL: parentURL
                                 create: YES error: &error];

_path looks like "/var/folders/4f/mvdftm3d5ss0ystm0m2q8q3m0000gn/T/CBL_BlobStoreTest”.
The error is NSCocoaErrorDomain Code=512, which is NSFileWriteUnknownError, described in FoundationErrors.h as "Write error, reason unknown”. Not very helpful…

No, I’m not out of disk space (4.4GB free at the moment.)

We actually had a bug reported a few months ago that stemmed from this, but we could never manage to reproduce it.

—Jens
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Why would creating NSItemReplacementDirectory fail?
      • From: Jens Alfke <email@hidden>
    • Re: Why would creating NSItemReplacementDirectory fail?
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Swift 2 generics and derived types
  • Next by Date: Re: Why would creating NSItemReplacementDirectory fail?
  • Previous by thread: Re: Swift 2 generics and derived types
  • Next by thread: Re: Why would creating NSItemReplacementDirectory fail?
  • Index(es):
    • Date
    • Thread