File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1062,6 +1062,29 @@ impl IoCtx {
10621062 . await
10631063 }
10641064
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+
10651088 /// Efficiently copy a portion of one object to another
10661089 /// If the underlying filesystem on the OSD supports it, this will be a
10671090 /// copy-on-write clone.
You can’t perform that action at this time.
0 commit comments