Skip to content

Commit

Permalink
XrdS3: add 'createdAt' when we create a new bucket with 'xrds3'
Browse files Browse the repository at this point in the history
  • Loading branch information
apeters1971 committed Jun 27, 2024
1 parent 6299391 commit 99cdb58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/XrdS3/app/xrds3
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import pwd
import ctypes
import ctypes.util
import errno
import time

def main():
# Create the main parser
Expand Down Expand Up @@ -591,6 +592,8 @@ def handle_addbucket(args):
try:
os.setxattr(bucket_file, 'user.s3.owner', username.encode())
os.setxattr(bucket_file, 'user.s3.path', bucketpath.encode())
current_timestamp = str(int(time.time()))
os.setxattr(user_bucket_file, "user.s3.createdAt", current_timestamp.encode());
print(f"Info: Extended attributes set on '{bucket_file}': 'user.s3.owner'={username}, 'user.s3.path'={bucketpath}")
except AttributeError:
print("Info: Extended attributes are not supported on this platform.")
Expand Down

0 comments on commit 99cdb58

Please sign in to comment.