bug-gnustep
[Top][All Lists]
Advanced

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

NSFileManager.m, mingw, _copyFile: toFile: handler:


From: Michael Scheibler
Subject: NSFileManager.m, mingw, _copyFile: toFile: handler:
Date: Tue, 27 Mar 2001 10:14:00 +0200

There is still a bug in NSFileManager (mingw). It is not possible to copy
files, in fact it ends in an infinite loop. I suggest to use the Win32
function CopyFile instead of reading and writing data "by hand":

- (BOOL) _copyFile: (NSString*)source
     toFile: (NSString*)destination
    handler: handler
{
#if defined(__MINGW__)
  if (CopyFile([self fileSystemRepresentationWithPath: source],
               [self fileSystemRepresentationWithPath: destination],
               NO))
    return YES;

  if (handler)
    {
      NSDictionary* errorInfo
       = [NSDictionary dictionaryWithObjectsAndKeys:
                       source, @"Path",
                       @"cannot copy file", @"Error",
                       destination, @"ToPath",
                       nil];
      return [handler fileManager: self
               shouldProceedAfterError: errorInfo];
    }
  else
      return NO;
#else /* !(__MINGW__) */
...
original code
...
#endif /* (__MINGW__) */
}




reply via email to

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