feat(services/fs): Add user defined metadata support #7061
Merged
+112
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Part of #4842.
Rationale for this change
Issue #4842 tracks adding user defined metadata support for various services. This PR implements user metadata support for the
fsservice using extended attributes (xattr) on Unix systems.What changes are included in this PR?
xattrcrate dependency for Unix platformswrite_with_user_metadatacapability in the fs backendget_user_metadata()andset_user_metadata()methods using xattrFsWriterto store and write user metadata when closing filesfs_stat()to read user metadata from xattrUser metadata is stored as extended attributes with the prefix
user.opendal.on the filesystem.Are there any user-facing changes?
Yes. Users can now use
op.write_with("path", data).user_metadata(metadata)to store custom metadata with files on thefsservice (Unix only).AI Usage Statement
This PR was developed with assistance from GitHub Copilot using Claude Opus 4.5.