File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1062,6 +1062,29 @@ impl IoCtx {
1062
1062
. await
1063
1063
}
1064
1064
1065
+ /// Get object stats (size,SystemTime)
1066
+ pub async fn rados_async_object_stat (
1067
+ & self ,
1068
+ object_name : & str ,
1069
+ ) -> RadosResult < ( u64 , SystemTime ) > {
1070
+ self . ioctx_guard ( ) ?;
1071
+ let object_name_str = CString :: new ( object_name) ?;
1072
+ let mut psize: u64 = 0 ;
1073
+ let mut time: :: libc:: time_t = 0 ;
1074
+
1075
+ with_completion ( self , |c| unsafe {
1076
+ rados_aio_stat (
1077
+ self . ioctx ,
1078
+ object_name_str. as_ptr ( ) ,
1079
+ c,
1080
+ & mut psize,
1081
+ & mut time,
1082
+ )
1083
+ } ) ?
1084
+ . await ?;
1085
+ Ok ( ( psize, ( UNIX_EPOCH + Duration :: from_secs ( time as u64 ) ) ) )
1086
+ }
1087
+
1065
1088
/// Efficiently copy a portion of one object to another
1066
1089
/// If the underlying filesystem on the OSD supports it, this will be a
1067
1090
/// copy-on-write clone.
You can’t perform that action at this time.
0 commit comments