# FR: Improve File::copyInternal -- by API change or logs

**URL:** <https://forum.juce.com/t/fr-improve-file-copyinternal-by-api-change-or-logs/54122>\
**Category:** Feature Requests\
**Created:** [December 14, 2022, 7:50pm UTC](https://forum.juce.com/t/fr-improve-file-copyinternal-by-api-change-or-logs/54122 "2022-12-14T19:50:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrlanglois](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jrlanglois/32/21372_2.png) [@jrlanglois](https://forum.juce.com/u/jrlanglois)\
**Post date:** [December 14, 2022, 7:50pm UTC](https://forum.juce.com/t/fr-improve-file-copyinternal-by-api-change-or-logs/54122/1 "2022-12-14T19:50:26Z")

</div>

Due to some [recent bungling of Finder when macOS Ventura hit the market](https://www.raspberrypi.com/news/the-ventura-problem/), we’re unable to copy files to hidden drives.

This was a hard one to track down, and we might have caught this a bit earlier if JUCE’s `File::copyInternal` (and the user facing `juce::File::copyFileTo`) logged errors and/or returned a `juce::Result` instead of a `bool`.

FWIW – what did help was this roughed in code for macOS:

```auto
bool File::copyInternal (const File& dest) const
{
    JUCE_AUTORELEASEPOOL
    {
        NSFileManager* fm = [NSFileManager defaultManager];

        NSError* error = nil;
        if (! ([fm fileExistsAtPath: juceStringToNS (fullPath)]
                && [fm copyItemAtPath: juceStringToNS (fullPath)
                               toPath: juceStringToNS (dest.getFullPathName())
                                error: &error]))
        {
            if (error != nullptr)
            {
                String message = "ERROR --- juce::File::copyInternal";
                message
                    << newLine << "localizedDescription: " << nsStringToJuce (error.localizedDescription)
                    << newLine << "localizedFailureReason: " << nsStringToJuce (error.localizedFailureReason)
                    << newLine << "localizedRecoverySuggestion: " << nsStringToJuce (error.localizedRecoverySuggestion)
                    << newLine << "domain: " << nsStringToJuce (error.domain)
                    << newLine << "code: " << String ((int64) error.code)
                    << newLine;

                Logger::writeToLog (message);
            }

            return false;
        }

        return true;
    }
}

```
