I just fixed this one recently, will be in the next release. The fix is in juce_mac_Files.cpp:
[code]bool juce_copyFile (const String& src, const String& dst)
{
const File destFile (dst);
if (! destFile.create())
return false;
FSRef srcRef, dstRef;
if (! (PlatformUtilities::makeFSRefFromPath (&srcRef, src)
&& PlatformUtilities::makeFSRefFromPath (&dstRef, dst)))
{
return false;
}
int okForks = 0;
CatPositionRec iter;
iter.initialize = 0;
HFSUniStr255 forkName;
// can't just copy the data because this is a bloody Mac, so we need to copy each
// fork separately...
while (FSIterateForks (&srcRef, &iter, &forkName, 0, 0) == noErr)
{
SInt16 srcForkNum = 0, dstForkNum = 0;
OSErr err = FSOpenFork (&srcRef, forkName.length, forkName.unicode, fsRdPerm, &srcForkNum);
if (err == noErr)
{
err = FSOpenFork (&dstRef, forkName.length, forkName.unicode, fsRdWrPerm, &dstForkNum);
if (err == noErr)
{
MemoryBlock buf (32768);
SInt64 pos = 0;
for (;;)
{
ByteCount bytesRead = 0;
err = FSReadFork (srcForkNum, fsFromStart, pos, buf.getSize(), (char*) buf, &bytesRead);
if (bytesRead > 0)
{
err = FSWriteFork (dstForkNum, fsFromStart, pos, bytesRead, (const char*) buf, &bytesRead);
pos += bytesRead;
}
if (err != noErr)
{
if (err == eofErr)
++okForks;
break;
}
}
FSFlushFork (dstForkNum);
FSCloseFork (dstForkNum);
}
FSCloseFork (srcForkNum);
}
}
return okForks > 0; // some files seem to be ok even if not all their forks get copied..
}[/code]