bug-gnustep
[Top][All Lists]
Advanced

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

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


From: Larry Campbell
Subject: [bug #51592] -[NSFileManager copyItemAtPath:toPath:error:] should not raise exceptions
Date: Thu, 27 Jul 2017 11:30:10 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4

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

                 Summary: -[NSFileManager copyItemAtPath:toPath:error:] should
not raise exceptions
                 Project: GNUstep
            Submitted by: lcampbel
            Submitted on: Thu 27 Jul 2017 03:30:08 PM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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 '%@'",
    source);

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];





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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