• 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
Bug with Localized Failure Reason and file moving
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug with Localized Failure Reason and file moving


  • Subject: Bug with Localized Failure Reason and file moving
  • From: Daryle Walker <email@hidden>
  • Date: Tue, 24 Mar 2015 20:44:33 -0400

A segment from my command-line tool:

>                 NSURL * const  finalLocation = [NSURL fileURLWithPath:response.suggestedFilename isDirectory:NO];
>
>                 [[NSFileManager defaultManager] moveItemAtURL:location toURL:finalLocation error:&error];
>                 if (error) {
>                     gbfprint(stderr, @"Error, copying: %@", error.localizedDescription);
>                     gbfprintln(stderr, error.localizedFailureReason ? @" (%@)" : @"", error.localizedFailureReason);
>                     returnCode = EXIT_FAILURE;
>                 } else {
>                     gbprintln(@"%@", finalLocation.path);
>                 }

When I run the tool a second time, with the same URL argument, so it tries moving the temp file to a place where a file already exists, I get:

> Error, copying: “CFNetworkDownload_8gfN5h.tmp” couldn’t be moved to “Debug” because an item with the same name already exists. (A file with the name “CFNetworkDownload_8gfN5h.tmp” already exists.)
> Program ended with exit code: 1

The localized failure reason uses the source file name, the real reason is that the DESTINATION file name is the one already in use.

Am I misunderstanding something here, or should I try to figure out how to send in bug reports to Apple?

—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com


_______________________________________________

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: Bug with Localized Failure Reason and file moving
      • From: Daryle Walker <email@hidden>
    • Re: Bug with Localized Failure Reason and file moving
      • From: email@hidden
    • Re: Bug with Localized Failure Reason and file moving
      • From: Quincey Morris <email@hidden>
  • Prev by Date: RTFD Compatibility Between OS X and iOS?
  • Next by Date: Best way to move a file out of the way?
  • Previous by thread: RTFD Compatibility Between OS X and iOS?
  • Next by thread: Re: Bug with Localized Failure Reason and file moving
  • Index(es):
    • Date
    • Thread