ReactOS
0.4.15-dev-7958-gcd0bb1a
movefile.c
Go to the documentation of this file.
1
/*
2
* COPYRIGHT: See COPYING in the top level directory
3
* PROJECT: ReactOS pending moves operations interactions tool
4
* FILE: cmdutils/movefile/movefile.c
5
* PURPOSE: Queue move operations for next reboot
6
* PROGRAMMERS: Pierre Schweitzer <pierre@reactos.org>
7
*/
8
9
#include <windows.h>
10
#include <tchar.h>
11
#include <stdio.h>
12
13
int
14
__cdecl
15
_tmain
(
int
argc
,
const
TCHAR
*
argv
[])
16
{
17
/* We need source + target */
18
if
(
argc
< 3)
19
{
20
_ftprintf
(
stderr
,
_T
(
"Missing arguments\nUsage: %s source target\nUse \"\" as target is you want deletion\n"
),
argv
[0]);
21
return
1;
22
}
23
24
/* If target is empty, it means deletion, so provide null pointer */
25
if
(!
MoveFileEx
(
argv
[1], (
argv
[2][0] == 0 ?
NULL
:
argv
[2]),
MOVEFILE_DELAY_UNTIL_REBOOT
))
26
{
27
_ftprintf
(
stderr
,
_T
(
"Error: %d\n"
),
GetLastError
());
28
return
1;
29
}
30
31
return
0;
32
}
argc
static int argc
Definition:
ServiceArgs.c:12
__cdecl
#define __cdecl
Definition:
accygwin.h:79
NULL
#define NULL
Definition:
types.h:112
stderr
#define stderr
Definition:
stdio.h:100
_tmain
#define _tmain
Definition:
tchar.h:497
_ftprintf
#define _ftprintf
Definition:
tchar.h:518
argv
#define argv
Definition:
mplay32.c:18
_T
#define _T(x)
Definition:
vfdio.h:22
GetLastError
DWORD WINAPI GetLastError(void)
Definition:
except.c:1042
MoveFileEx
#define MoveFileEx
Definition:
winbase.h:3878
MOVEFILE_DELAY_UNTIL_REBOOT
#define MOVEFILE_DELAY_UNTIL_REBOOT
Definition:
winbase.h:400
TCHAR
char TCHAR
Definition:
xmlstorage.h:189
modules
rosapps
applications
rosinternals
movefile
movefile.c
Generated on Fri Apr 26 2024 06:06:24 for ReactOS by
1.9.6