bug-gnustep
[Top][All Lists]
Advanced

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

NSFileManager.m (mingw/cygwin)


From: Michael Scheibler
Subject: NSFileManager.m (mingw/cygwin)
Date: Wed, 21 Mar 2001 11:14:50 +0100

1. _attributesAtPath: traverseLink: forCopy:


  if (traverse)
    {
      if (stat(cpath, &statbuf) != 0)
        return nil;
    }
#ifdef S_IFLNK
  else
    {
      if (lstat(cpath, &statbuf) != 0)
        return nil;
    }
#endif


MinGW does not have lstat because it even doesn't have links -> if traverse
is NO no attributes are read.

I suggest to insert following lines:


#if defined(__MINGW__)
  if (stat(cpath, &statbuf) != 0)
    return nil;
#else /* !(__MINGW__) */
// here the original code above
#endif /* (__MINGW__) */


------------------------

2. _copyFile: toFile: handler:


I don't know why, but somehow read() doesn't read correctly. It only reads
the first buffer and a few bytes from the second. After that it return 0
bytes read -> infinite loop.

What about using the Win32 function CopyFile? You don't have to bother with
buffers and reading and writing and so on. Only one function call which
succeeds or fails.

Michael




reply via email to

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