function fm_mkfile($dest, $overwrite = false, $content = '')
{
    global $ftp, $ftp_prepath;
    if (!fm_ftpconnect()) {
        return false;
    }
    aphp($dest);
    $dest = fm_prepareoverwrite($dest, $overwrite);
    if (!$dest) {
        return false;
    }
    $fhandle = @fopen('cache/temp.bin', 'w');
    if ($fhandle === false) {
        return false;
    }
    if ($content) {
        @fwrite($fhandle, $content);
    }
    @fclose($fhandle);
    return @ftp_put($ftp, $ftp_prepath . $dest, 'cache/temp.bin', FTP_BINARY);
}
function fm_mkfile($file, $overwrite = false, $content = '')
{
    global $prepath;
    aphp($file);
    $file = fm_prepareoverwrite($file, $overwrite);
    if (!$file) {
        return false;
    }
    $handle = @fopen($prepath . $file, 'x');
    if ($content && $handle) {
        @fwrite($handle, $content);
    }
    return @fclose($handle);
}