secureswitools/swisistools/source/sisxlibrary/utility_windows.cpp
branchRCL_3
changeset 65 7333d7932ef7
parent 62 5cc91383ab1e
child 66 8b7f4e561641
equal deleted inserted replaced
62:5cc91383ab1e 65:7333d7932ef7
   183 int GetErrorValue()
   183 int GetErrorValue()
   184 	{
   184 	{
   185 	return ::GetLastError();
   185 	return ::GetLastError();
   186 	}
   186 	}
   187 
   187 
   188 int FileCopyA(const char* aSrc, const char* aDest, size_t aFlag)
   188 int FileCopyA(const char* aSrc, const char* aDest, bool aFailIfExistsFlag)
   189 {
   189 {
   190 	int err=CopyFileA(aSrc,aDest,aFlag);
   190 	// CopyFileA() returns zero on failure and non-zero otherwise.
   191 	return err;
   191 	int err=CopyFileA(aSrc,aDest,aFailIfExistsFlag);
       
   192 	// To maintain consistency with the LINUX wrapper API FileCopyA() which uses cp 
       
   193 	// command with system(), we return 0 on success and 1 on failure.
       
   194 	return !err;
   192 }
   195 }
   193 
   196 
   194 int FileMoveA(const char* aSrc, const char* aDest)
   197 int FileMoveA(const char* aSrc, const char* aDest)
   195 {
   198 {
       
   199 	// MoveFileA() returns zero on failure and non-zero otherwise.
   196 	int err=MoveFileA(aSrc,aDest);
   200 	int err=MoveFileA(aSrc,aDest);
   197 	return err;
   201 	// To maintain consistency with the LINUX wrapper API FileMoveA() which uses mv
       
   202 	// command with system(), we return 0 on success and 1 on failure.
       
   203 	return !err;
   198 }
   204 }
   199 
   205