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


You are not allowed to post comments on this tracker with your current authentication level.

bug #51592: -[NSFileManager copyItemAtPath:toPath:error:] should not raise exceptions

Submitted by:  Larry Campbell <lcampbel>
Submitted on:  Thu 27 Jul 2017 03:30:08 PM UTC  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Thu 27 Jul 2017 03:30:08 PM UTC, original submission:

At the top of _copyFile:toFile:handler:, we have this:

/* Assumes source is a file and exists! */
NSAssert1 ([self fileExistsAtPath: source],
@"source file '%@' does not exist!", source);

attributes = [self fileAttributesAtPath: source traverseLink: NO];
NSAssert1 (attributes, @"could not get the attributes for file '%@'",

However, any other error causes the handler (if any) to be called and NO to be returned. I think these asserts should be replaced by something like:

if (!exists)
return [self _proceedAccordingToHandler: handler
forError: @"source file does not exist"
inPath: source
fromPath: source
toPath: destination];

Larry Campbell <lcampbel>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by lcampbel (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    No Changes Have Been Made to This Item

    Back to the top

    Powered by Savane 3.1-cleanup1