MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / dFileTouch

Function dFileTouch

Engine/source/platformWin32/winFileio.cpp:100–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100bool 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
125bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite)
126{

Callers 1

TESTFunction · 0.50

Calls 5

convertUTF8toUTF16NFunction · 0.85
dStrcpyFunction · 0.85
backslashFunction · 0.85
CreateFileFunction · 0.85
dStrlenFunction · 0.50

Tested by 1

TESTFunction · 0.40