36#ifdef INCLUDE_CMD_COPY
74 TRACE (
"checking mode\n");
114 TRACE (
"getting time\n");
118 TRACE (
"copy: flags has %s\n",
160 TRACE (
"opening/creating\n");
176 LONG lFilePosHigh = 0;
184 TRACE (
"opening/appending\n");
245 TRACE (
"setting time\n");
252 TRACE (
"appending ^Z\n");
260 TRACE (
"setting mode\n");
303 while (*pszTarget != 0)
305 if (*pszTarget ==
_T(
'*'))
308 while ((*pszSource != 0) && (*pszSource != *pszTarget))
310 *pszOutput++ = *pszSource++;
313 else if (*pszTarget ==
_T(
'?'))
318 *pszOutput++ = *pszSource++;
323 *pszOutput++ = *pszTarget++;
335 INT argc,
i, nFiles, nOverwrite = 0, nSrc = -1, nDes = -1;
346 TCHAR * appendPointer =
_T(
"\0");
381 TCHAR *old_evar = evar;
518 else if (*
arg[
i] ==
_T(
'+'))
580 bMultipleSource =
TRUE;
596 if ((
arg[nDes][1] ==
_T(
':')) && (
arg[nDes][2] ==
_T(
'\0')))
610 bMultipleDest =
TRUE;
611 if (szDestPath[
_tcslen(szDestPath) - 1] !=
_T(
'\\'))
619 bMultipleDest =
TRUE;
625 if (bMultipleSource && !bMultipleDest)
631 appendPointer =
arg[nSrc];
640 *UseThisName++ =
_T(
'\0');
643 if (((UseThisName[0] ==
_T(
'*')) && (UseThisName[1] ==
_T(
'\0'))) ||
644 (UseThisName[0] ==
_T(
'\0')))
655 UseThisName = szDestPath;
664 szSrcPath[0] =
_T(
'\0');
670 if (appendPointer[0] ==
_T(
'|'))
676 else if (appendPointer[0] ==
_T(
'\0'))
682 _tcsncat(szSrcPath, appendPointer, 1);
692 if (
_tcsncmp(szTouch,
_T(
"|,,\0"), 4) || (nDes != -1))
710 if ((szSrcPath[1] ==
_T(
':')) && (szSrcPath[2] ==
_T(
'\0')))
731 if (szSrcPath[
_tcslen(szSrcPath) - 1] !=
_T(
'\\'))
738 if (szSrcPath[
_tcslen(szSrcPath) - 1] ==
_T(
'\\'))
761 for (
i = (
_tcslen(szSrcPath) - 1);
i > -1;
i--)
763 if (szSrcPath[
i] !=
_T(
'\\'))
764 szSrcPath[
i] =
_T(
'\0');
783 if (!
_tcscmp(findBuffer.cFileName,
_T(
".")) ||
784 !
_tcscmp(findBuffer.cFileName,
_T(
"..")) ||
791 _tcscpy(tmpDestPath, szDestPath);
795 if (
_tcscmp(tmpDestPath,
_T(
"\\\\.\\")) &&
807 _tcscat(tmpDestPath, findBuffer.cFileName);
814 _tcscat(tmpDestPath, UseThisName);
826 _tcscat(tmpDestPath, DoneFile);
832 _tcscat (tmpSrcPath, findBuffer.cFileName);
835 if (!bTouch && !
_tcscmp(tmpSrcPath, tmpDestPath))
856 if (
copy(tmpSrcPath,tmpDestPath, bAppend,
dwFlags, bTouch))
#define STRING_ERROR_INVALID_PARAM_FORMAT
#define STRING_ERROR_OUT_OF_MEMORY
#define STRING_COPY_ERROR1
#define STRING_COPY_ERROR3
VOID ConOutResPaging(BOOL StartPaging, UINT resID)
#define ConOutPrintf(szStr,...)
#define ConErrResPrintf(uID,...)
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
static INT CopyOverwrite(LPTSTR fn)
static void BuildFileName(LPTSTR pszSource, LPTSTR pszTarget, LPTSTR pszOutput)
INT cmd_copy(LPTSTR param)
#define STRING_COPY_HELP2
#define STRING_COPY_ERROR2
#define STRING_ERROR_INVALID_SWITCH
#define STRING_ERROR_PATH_NOT_FOUND
#define STRING_ERROR_TOO_MANY_PARAMETERS
#define STRING_COPY_HELP1
#define STRING_ERROR_REQ_PARAM_MISSING
static VOID freep(LPSTR *p)
static LPSTR * split(LPSTR s, LPINT args)
#define cmd_realloc(ptr, size)
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI SetFileTime(IN HANDLE hFile, CONST FILETIME *lpCreationTime OPTIONAL, CONST FILETIME *lpLastAccessTime OPTIONAL, CONST FILETIME *lpLastWriteTime OPTIONAL)
BOOL WINAPI GetFileTime(IN HANDLE hFile, OUT LPFILETIME lpCreationTime OPTIONAL, OUT LPFILETIME lpLastAccessTime OPTIONAL, OUT LPFILETIME lpLastWriteTime OPTIONAL)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
BOOL WINAPI SystemTimeToFileTime(IN CONST SYSTEMTIME *lpSystemTime, OUT LPFILETIME lpFileTime)
VOID WINAPI GetSystemTime(OUT LPSYSTEMTIME lpSystemTime)
struct _FileName FileName
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static void append(struct dump_context *dc, const void *data, unsigned size)
#define ERROR_FILE_NOT_FOUND
#define FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_DIRECTORY
BOOL IsExistingDirectory(IN LPCTSTR pszPath)
BOOL IsExistingFile(IN LPCTSTR pszPath)
INT GetRootPath(IN LPCTSTR InPath, OUT LPTSTR OutPath, IN INT size)
#define ConOutResPrintf(uID,...)
#define ConOutFormatMessage(MessageId,...)
#define ConOutResPuts(uID)
INT FilePromptYNA(UINT resID)
static GLenum _GLUfuncptr fn
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
#define GetEnvironmentVariable
#define COPY_FILE_RESTARTABLE
DWORD WINAPI GetLastError(void)
#define GetFileAttributes
#define SetFileAttributes
#define COPY_FILE_ALLOW_DECRYPTED_DESTINATION
#define GetCurrentDirectory
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags