public FATFile copyTo(FATFolder dst, boolean overwrite) throws IOException {
        FATLock lockSrc = tryLockThrowInternal(false);

        //deep copy instance
        FATFile dstFile = null;
        //child list snapshot
        FATFile[] srcChildren = null;
        try {
            FATLock lockFolder = dst.asFile().getLockInternal(true);
            try {
                if (overwrite) {
                    dstFile = dst.findFile(getName());
                    if (fileId == dstFile.fileId)
                        throw new IOException("Cannot copy to self");

                    if (dstFile.type != type) {
                        // let's delete files and empty folders
                        // tree deletion is too strong [overwrite] suggestion.
                        dstFile.delete();
                        dstFile = null;
                    }
                }
                if (dstFile == null)
                    dstFile = dst.createFile(getName(), type);
            } finally {
                lockFolder.unlock();
            }

            if (isFolder())
                srcChildren = getFolder().listFiles();
            else {
                FATLock lockDst = dstFile.tryLockThrowInternal(true);
                try {
                    // delegate to low level to supports
                    // system hints like "sparse files"
                    fs.copyFile(this, dstFile);
                } finally {
                    lockDst.unlock();
                }
            }
            //commit
        } finally {
            lockSrc.unlock();
        }

        // copy from snapshot
        if (srcChildren != null) {
            FATFolder dstFolder = dstFile.getFolder();
            for(FATFile child : srcChildren){
                child.copyTo(dstFolder, overwrite);
            }
        }
        return dstFile;
    }