@@ -29,6 +29,7 @@ pub struct FileAttr {
29
29
creation_time : c:: FILETIME ,
30
30
last_access_time : c:: FILETIME ,
31
31
last_write_time : c:: FILETIME ,
32
+ change_time : Option < c:: FILETIME > ,
32
33
file_size : u64 ,
33
34
reparse_tag : c:: DWORD ,
34
35
volume_serial_number : Option < u32 > ,
@@ -352,6 +353,7 @@ impl File {
352
353
creation_time : info. ftCreationTime ,
353
354
last_access_time : info. ftLastAccessTime ,
354
355
last_write_time : info. ftLastWriteTime ,
356
+ change_time : None , // Only available in FILE_BASIC_INFO
355
357
file_size : ( info. nFileSizeLow as u64 ) | ( ( info. nFileSizeHigh as u64 ) << 32 ) ,
356
358
reparse_tag,
357
359
volume_serial_number : Some ( info. dwVolumeSerialNumber ) ,
@@ -388,6 +390,10 @@ impl File {
388
390
dwLowDateTime : info. LastWriteTime as c:: DWORD ,
389
391
dwHighDateTime : ( info. LastWriteTime >> 32 ) as c:: DWORD ,
390
392
} ,
393
+ change_time : Some ( c:: FILETIME {
394
+ dhLowDateTime : info. ChangeTime as c:: DWORD ,
395
+ dhHighDateTime : ( info. ChangeTime >> 32 ) as c:: DWORD ,
396
+ } ) ,
391
397
file_size : 0 ,
392
398
reparse_tag : 0 ,
393
399
volume_serial_number : None ,
@@ -956,6 +962,10 @@ impl FileAttr {
956
962
to_u64 ( & self . creation_time )
957
963
}
958
964
965
+ pub fn changed_u64 ( & self ) -> Option < u64 > {
966
+ self . changed_time . map ( |c| to_u64 ( c) )
967
+ }
968
+
959
969
pub fn volume_serial_number ( & self ) -> Option < u32 > {
960
970
self . volume_serial_number
961
971
}
@@ -975,6 +985,7 @@ impl From<c::WIN32_FIND_DATAW> for FileAttr {
975
985
creation_time : wfd. ftCreationTime ,
976
986
last_access_time : wfd. ftLastAccessTime ,
977
987
last_write_time : wfd. ftLastWriteTime ,
988
+ change_time : None ,
978
989
file_size : ( ( wfd. nFileSizeHigh as u64 ) << 32 ) | ( wfd. nFileSizeLow as u64 ) ,
979
990
reparse_tag : if wfd. dwFileAttributes & c:: FILE_ATTRIBUTE_REPARSE_POINT != 0 {
980
991
// reserved unless this is a reparse point
0 commit comments