void writeTimeStamp()

in src/main/cpp/launcher/windows/src/FileUtils.c [75:123]


void writeTimeStamp(HANDLE hd, DWORD need) {
    DWORD written;
    if(need==1) {
        SYSTEMTIME t;	
        char * yearStr;
        char * monthStr;
        char * dayStr;
        char * hourStr;
        char * minuteStr;
        char * secondStr;
        char * msStr;
        char * result = NULL;
        GetLocalTime(&t);
        yearStr = word2charN(t.wYear,2);
        monthStr = word2charN(t.wMonth,2);
        dayStr = word2charN(t.wDay,2);
        hourStr = word2charN(t.wHour,2);
        minuteStr = word2charN(t.wMinute,2);
        secondStr = word2charN(t.wSecond,2);
        msStr = word2charN(t.wMilliseconds,3);
        
        result = appendString(NULL, "[");
        result = appendString(result, yearStr);
        result = appendString(result, "-");
        result = appendString(result, monthStr);
        result = appendString(result, "-");
        result = appendString(result, dayStr);
        result = appendString(result, " ");
        result = appendString(result, hourStr);
        result = appendString(result, ":");
        result = appendString(result, minuteStr);
        result = appendString(result, ":");
        result = appendString(result, secondStr);
        result = appendString(result, ".");
        result = appendString(result, msStr);
        result = appendString(result, "]> ");

        WriteFile(hd, result, sizeof(char) * getLengthA(result), & written, NULL);
        FREE(result);
        FREE(yearStr);
        FREE(monthStr);
        FREE(dayStr);

        FREE(hourStr);
        FREE(minuteStr);
        FREE(secondStr);
        FREE(msStr);
    }
}