일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Splunk
- pandas
- javascript
- keras
- synology
- Python
- ipad
- pip
- RNN
- Series
- pycharm
- GitHub
- mean
- Button
- SciPy
- SPL
- mariadb
- DFS
- Lotto
- 삼성소프트웨어멤버십
- Numpy
- imread
- 알고리즘
- install
- CNN
- dataframe
- index
- E-P1
- GT-S80
- LSTM
Archives
- Today
- Total
잠토의 잠망경
[FILE 생성 시간, 접근 시간, Write 시간] GetFileTime, FileTimeToSystemTime, SystemTimeToTzSpecificLocalTime 본문
카테고리 없음
[FILE 생성 시간, 접근 시간, Write 시간] GetFileTime, FileTimeToSystemTime, SystemTimeToTzSpecificLocalTime
잠수함토끼 2012. 1. 1. 23:38File의 생성 시간, 접근 시간, Write 시간 알아내기
http://www.tipssoft.com/ 에서 학습한 내용을 바탕으로 재 코딩 한 것임을 알려드립니다.
voidCGetFileTimeDlg::OnBnClickedButton1() { // TODO: 여기에컨트롤알림처리기코드를추가합니다. /* The GetFileTime function retrieves the date and time that a file was created, last accessed, and last modified. BOOL GetFileTime( HANDLE hFile, // identifies the file LPFILETIME lpCreationTime, // address of creation time LPFILETIME lpLastAccessTime, // address of last access time LPFILETIME lpLastWriteTime // address of last write time ); The FileTimeToSystemTime function converts a 64-bit file time to system time format. BOOL FileTimeToSystemTime( CONST FILETIME * lpFileTime, // pointer to file time to convert LPSYSTEMTIME lpSystemTime // pointer to structure to receive system time ); The SystemTimeToTzSpecificLocalTime function converts a Coordinated Universal Time (UTC) to a specified time zone's corresponding local time. BOOL SystemTimeToTzSpecificLocalTime ( LPTIME_ZONE_INFORMATION lpTimeZoneInformation, // pointer to time zone of interest LPSYSTEMTIME lpUniversalTime, // pointer to universal time of interest LPSYSTEMTIME lpLocalTime // pointer to structure to receive local time ); */ DWORD dWord = 0; HANDLE h_file = CreateFile(_T("C:\\test.ini"),GENERIC_READ,FILE_SHARE_READ,NULL, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); if(h_file != INVALID_HANDLE_VALUE) { FILETIME create_time, access_time, write_time; BOOL retVal = GetFileTime( h_file, // identifies the file &create_time, // address of creation time &access_time, // address of last access time &write_time); // address of last write time if(!retVal) { dWord = GetLastError(); } SYSTEMTIME write_system_time, write_local_time; retVal = FileTimeToSystemTime( &write_time, // pointer to file time to convert &write_system_time);// pointer to structure to receive system time if(!retVal) { dWord = GetLastError(); } retVal = SystemTimeToTzSpecificLocalTime( NULL, // &write_system_time, // UTC &write_local_time); // 변경될LOCAL 시간 if(!retVal) { dWord = GetLastError(); } CloseHandle(h_file); } else { DWORD dWord = GetLastError(); } }
Comments