Author: pschweitzer Date: Sun Aug 13 10:15:55 2017 New Revision: 75531
URL: http://svn.reactos.org/svn/reactos?rev=75531&view=rev Log: [MOVEFILE] Open source the movefile utily that allows queueing deletion/renaming operations for the next reboot
Added: trunk/rosapps/applications/rosinternals/movefile/ trunk/rosapps/applications/rosinternals/movefile/CMakeLists.txt (with props) trunk/rosapps/applications/rosinternals/movefile/movefile.c (with props) trunk/rosapps/applications/rosinternals/movefile/movefile.rc (with props) Modified: trunk/rosapps/applications/rosinternals/CMakeLists.txt
Modified: trunk/rosapps/applications/rosinternals/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/rosinternals/C... ============================================================================== --- trunk/rosapps/applications/rosinternals/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/applications/rosinternals/CMakeLists.txt [iso-8859-1] Sun Aug 13 10:15:55 2017 @@ -1,2 +1,3 @@ +add_subdirectory(movefile) add_subdirectory(ntfsinfo) add_subdirectory(pendmoves)
Added: trunk/rosapps/applications/rosinternals/movefile/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/rosinternals/m... ============================================================================== --- trunk/rosapps/applications/rosinternals/movefile/CMakeLists.txt (added) +++ trunk/rosapps/applications/rosinternals/movefile/CMakeLists.txt [iso-8859-1] Sun Aug 13 10:15:55 2017 @@ -0,0 +1,5 @@ +list(APPEND SOURCE movefile.c movefile.rc) +add_executable(movefile ${SOURCE}) +set_module_type(movefile win32cui UNICODE) +add_importlibs(movefile msvcrt kernel32 ntdll) +add_cd_file(TARGET movefile DESTINATION reactos/system32 FOR all)
Propchange: trunk/rosapps/applications/rosinternals/movefile/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/rosapps/applications/rosinternals/movefile/movefile.c URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/rosinternals/m... ============================================================================== --- trunk/rosapps/applications/rosinternals/movefile/movefile.c (added) +++ trunk/rosapps/applications/rosinternals/movefile/movefile.c [iso-8859-1] Sun Aug 13 10:15:55 2017 @@ -0,0 +1,32 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS pending moves operations interactions tool + * FILE: cmdutils/movefile/movefile.c + * PURPOSE: Queue move operations for next reboot + * PROGRAMMERS: Pierre Schweitzer pierre@reactos.org + */ + +#include <windows.h> +#include <tchar.h> +#include <stdio.h> + +int +__cdecl +_tmain(int argc, const TCHAR *argv[]) +{ + /* We need source + target */ + if (argc < 3) + { + _ftprintf(stderr, _T("Missing arguments\nUsage: %s source target\nUse "" as target is you want deletion\n"), argv[0]); + return 1; + } + + /* If target is empty, it means deletion, so provide null pointer */ + if (!MoveFileEx(argv[1], (argv[2][0] == 0 ? NULL : argv[2]), MOVEFILE_DELAY_UNTIL_REBOOT)) + { + _ftprintf(stderr, _T("Error: %d\n"), GetLastError()); + return 1; + } + + return 0; +}
Propchange: trunk/rosapps/applications/rosinternals/movefile/movefile.c ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/rosapps/applications/rosinternals/movefile/movefile.rc URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/rosinternals/m... ============================================================================== --- trunk/rosapps/applications/rosinternals/movefile/movefile.rc (added) +++ trunk/rosapps/applications/rosinternals/movefile/movefile.rc [iso-8859-1] Sun Aug 13 10:15:55 2017 @@ -0,0 +1,4 @@ +#define REACTOS_STR_FILE_DESCRIPTION "Queue move operations for next reboot\0" +#define REACTOS_STR_INTERNAL_NAME "movefile\0" +#define REACTOS_STR_ORIGINAL_FILENAME "movefile.exe\0" +#include <reactos/version.rc>
Propchange: trunk/rosapps/applications/rosinternals/movefile/movefile.rc ------------------------------------------------------------------------------ svn:eol-style = native