@@ -32,6 +32,7 @@ pub struct FileAttr {
32
32
creation_time : c:: FILETIME ,
33
33
last_access_time : c:: FILETIME ,
34
34
last_write_time : c:: FILETIME ,
35
+ change_time : Option < c:: FILETIME > ,
35
36
file_size : u64 ,
36
37
reparse_tag : u32 ,
37
38
volume_serial_number : Option < u32 > ,
@@ -377,6 +378,7 @@ impl File {
377
378
creation_time : info. ftCreationTime ,
378
379
last_access_time : info. ftLastAccessTime ,
379
380
last_write_time : info. ftLastWriteTime ,
381
+ change_time : None , // Only available in FILE_BASIC_INFO
380
382
file_size : ( info. nFileSizeLow as u64 ) | ( ( info. nFileSizeHigh as u64 ) << 32 ) ,
381
383
reparse_tag,
382
384
volume_serial_number : Some ( info. dwVolumeSerialNumber ) ,
@@ -413,6 +415,10 @@ impl File {
413
415
dwLowDateTime : info. LastWriteTime as u32 ,
414
416
dwHighDateTime : ( info. LastWriteTime >> 32 ) as u32 ,
415
417
} ,
418
+ change_time : Some ( c:: FILETIME {
419
+ dhLowDateTime : info. ChangeTime as c:: DWORD ,
420
+ dhHighDateTime : ( info. ChangeTime >> 32 ) as c:: DWORD ,
421
+ } ) ,
416
422
file_size : 0 ,
417
423
reparse_tag : 0 ,
418
424
volume_serial_number : None ,
@@ -957,6 +963,10 @@ impl FileAttr {
957
963
to_u64 ( & self . creation_time )
958
964
}
959
965
966
+ pub fn changed_u64 ( & self ) -> Option < u64 > {
967
+ self . change_time . as_ref ( ) . map ( |c| to_u64 ( c) )
968
+ }
969
+
960
970
pub fn volume_serial_number ( & self ) -> Option < u32 > {
961
971
self . volume_serial_number
962
972
}
@@ -976,6 +986,7 @@ impl From<c::WIN32_FIND_DATAW> for FileAttr {
976
986
creation_time : wfd. ftCreationTime ,
977
987
last_access_time : wfd. ftLastAccessTime ,
978
988
last_write_time : wfd. ftLastWriteTime ,
989
+ change_time : None ,
979
990
file_size : ( ( wfd. nFileSizeHigh as u64 ) << 32 ) | ( wfd. nFileSizeLow as u64 ) ,
980
991
reparse_tag : if wfd. dwFileAttributes & c:: FILE_ATTRIBUTE_REPARSE_POINT != 0 {
981
992
// reserved unless this is a reparse point
0 commit comments