|
@@ -1260,15 +1260,22 @@ bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path)
|
|
|
|
|
|
|
|
bool SystemTools::Touch(const kwsys_stl::string& filename, bool create)
|
|
bool SystemTools::Touch(const kwsys_stl::string& filename, bool create)
|
|
|
{
|
|
{
|
|
|
- if(create && !SystemTools::FileExists(filename))
|
|
|
|
|
|
|
+ if (!SystemTools::FileExists(filename))
|
|
|
{
|
|
{
|
|
|
- FILE* file = Fopen(filename, "a+b");
|
|
|
|
|
- if(file)
|
|
|
|
|
|
|
+ if(create)
|
|
|
|
|
+ {
|
|
|
|
|
+ FILE* file = Fopen(filename, "a+b");
|
|
|
|
|
+ if(file)
|
|
|
|
|
+ {
|
|
|
|
|
+ fclose(file);
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
{
|
|
{
|
|
|
- fclose(file);
|
|
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
- return false;
|
|
|
|
|
}
|
|
}
|
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
|
HANDLE h = CreateFileW(
|
|
HANDLE h = CreateFileW(
|