RTFileMove-generic.cpp revision c97989161fbe75bc14cea477a5443bbf474dd3ad
/* $Id$ */
/** @file
* innotek Portable Runtime - RTFileMove, Generic.
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
#define LOG_GROUP RTLOGGROUP_FILE
{
/*
* Validate input.
*/
/*
* Try RTFileRename first.
*/
if (rc == VERR_NOT_SAME_DEVICE)
{
/*
* The source and target are not on the same device, darn.
* We'll try open both ends and perform a copy.
*/
if (RT_SUCCESS(rc))
{
if (RT_SUCCESS(rc))
{
if (RT_SUCCESS(rc))
else
{
Log(("RTFileMove('%s', '%s', %#x): copy failed, rc=%Rrc\n",
}
/* try delete without closing, and could perhaps avoid some trouble */
if (RT_SUCCESS(rc2))
}
else
Log(("RTFileMove('%s', '%s', %#x): failed to create destination, rc=%Rrc\n",
}
else
Log(("RTFileMove('%s', '%s', %#x): failed to open source, rc=%Rrc\n",
/* if we failed to close it while open, close it now */
if (pszDelete)
{
if (RT_FAILURE(rc2))
Log(("RTFileMove('%s', '%s', %#x): failed to delete '%s', rc2=%Rrc (rc=%Rrc)\n",
}
}
LogFlow(("RTDirRename(%p:{%s}, %p:{%s}, %#x): returns %Rrc\n",
return rc;
}