| 98 | } |
| 99 | |
| 100 | bool dFileTouch(const char * name) |
| 101 | { |
| 102 | AssertFatal( name != NULL, "dFileTouch - NULL file name" ); |
| 103 | |
| 104 | TempAlloc< TCHAR > buf( dStrlen( name ) + 1 ); |
| 105 | |
| 106 | #ifdef UNICODE |
| 107 | convertUTF8toUTF16N( name, buf, buf.size ); |
| 108 | #else |
| 109 | dStrcpy( buf, name, buf.size ); |
| 110 | #endif |
| 111 | |
| 112 | backslash( buf ); |
| 113 | FILETIME ftime; |
| 114 | GetSystemTimeAsFileTime( &ftime ); |
| 115 | HANDLE handle = CreateFile( buf, FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, |
| 116 | NULL, OPEN_EXISTING, 0, NULL ); |
| 117 | if( handle == INVALID_HANDLE_VALUE ) |
| 118 | return false; |
| 119 | bool result = SetFileTime( handle, NULL, NULL, &ftime ); |
| 120 | CloseHandle( handle ); |
| 121 | |
| 122 | return result; |
| 123 | }; |
| 124 | |
| 125 | bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite) |
| 126 | { |