diff options
| author | click <none@none> | 2010-08-07 19:01:57 +0200 |
|---|---|---|
| committer | click <none@none> | 2010-08-07 19:01:57 +0200 |
| commit | ce435f6d4f84462c0707bbc608d767648d5e99c3 (patch) | |
| tree | dabac44fd559c925acf2171adb0ae3038f05ad7b /externals/mysql/mysys/my_delete.c | |
| parent | 3cc24e0971f96b9ffa4032a154750e4224ea499d (diff) | |
BuildSystem/VS: Remove now defunct an unmaintained buildfiles - use CMake for generating solutionfiles
--HG--
branch : trunk
Diffstat (limited to 'externals/mysql/mysys/my_delete.c')
| -rw-r--r-- | externals/mysql/mysys/my_delete.c | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/externals/mysql/mysys/my_delete.c b/externals/mysql/mysys/my_delete.c deleted file mode 100644 index edee1c4e875..00000000000 --- a/externals/mysql/mysys/my_delete.c +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include "mysys_priv.h" -#include "mysys_err.h" -#include <my_sys.h> - -int my_delete(const char *name, myf MyFlags) -{ - int err; - DBUG_ENTER("my_delete"); - DBUG_PRINT("my",("name %s MyFlags %d", name, MyFlags)); - - if ((err = unlink(name)) == -1) - { - my_errno=errno; - if (MyFlags & (MY_FAE+MY_WME)) - my_error(EE_DELETE,MYF(ME_BELL+ME_WAITTANG+(MyFlags & ME_NOINPUT)), - name,errno); - } - else if ((MyFlags & MY_SYNC_DIR) && - my_sync_dir_by_file(name, MyFlags)) - err= -1; - DBUG_RETURN(err); -} /* my_delete */ - -#if defined(__WIN__) -/** - Delete file which is possibly not closed. - - This function is intended to be used exclusively as a temporal solution - for Win NT in case when it is needed to delete a not closed file (note - that the file must be opened everywhere with FILE_SHARE_DELETE mode). - Deleting not-closed files can not be supported on Win 98|ME (and because - of that is considered harmful). - - The function deletes the file with its preliminary renaming. This is - because when not-closed share-delete file is deleted it still lives on - a disk until it will not be closed everwhere. This may conflict with an - attempt to create a new file with the same name. The deleted file is - renamed to <name>.<num>.deleted where <name> - the initial name of the - file, <num> - a hexadecimal number chosen to make the temporal name to - be unique. - - @param the name of the being deleted file - @param the flags instructing how to react on an error internally in - the function - - @note The per-thread @c my_errno holds additional info for a caller to - decide how critical the error can be. - - @retval - 0 ok - @retval - 1 error - - -*/ -int nt_share_delete(const char *name, myf MyFlags) -{ - char buf[MAX_PATH + 20]; - ulong cnt; - DBUG_ENTER("nt_share_delete"); - DBUG_PRINT("my",("name %s MyFlags %d", name, MyFlags)); - - for (cnt= GetTickCount(); cnt; cnt--) - { - errno= 0; - sprintf(buf, "%s.%08X.deleted", name, cnt); - if (MoveFile(name, buf)) - break; - - if ((errno= GetLastError()) == ERROR_ALREADY_EXISTS) - continue; - - /* This happened during tests with MERGE tables. */ - if (errno == ERROR_ACCESS_DENIED) - continue; - - DBUG_PRINT("warning", ("Failed to rename %s to %s, errno: %d", - name, buf, errno)); - break; - } - - if (errno == ERROR_FILE_NOT_FOUND) - { - my_errno= ENOENT; // marking, that `name' doesn't exist - } - else if (errno == 0) - { - if (DeleteFile(buf)) - DBUG_RETURN(0); - else if ((my_errno= GetLastError()) == 0) - my_errno= ENOENT; // marking, that `buf' doesn't exist - } else - my_errno= errno; - - if (MyFlags & (MY_FAE+MY_WME)) - my_error(EE_DELETE, MYF(ME_BELL + ME_WAITTANG + (MyFlags & ME_NOINPUT)), - name, my_errno); - DBUG_RETURN(-1); -} -#endif |
