-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Description
Describe the enhancement requested
Implement Result<FileInfo> AzureFileSystem::GetFileInfo(const std::string& path).
Logic I suggest we apply:
- Parse the string path to
AzurePath. - If
path.container.empty()then this is the root of the storage account. Its a directory and we don't really have any more info to add. - If
path.path_to_file.empty()then this is the root of a container. Try to fetch properties of the container. If the container exists and notIsDeleted()then its a directory and probably we can add the last modified time. - Call BlobClient::GetProperties(). If the storage account is hierarchical namespace it possible that we will get the properties for a directory, so we should always check this https://github.com/Azure/azure-sdk-for-cpp/blob/dd236311193c6a3debf3b12c47f14e49a20c72c7/sdk/storage/azure-storage-files-datalake/src/datalake_utilities.cpp#L86-L91.
All of this only needs the simple blob endpoints - nothing exclusive to hierarchical namespace enabled accounts.
The other GetFileInfo method requires doing directory listing which will be some additional complexity so I propose implementing that in a separate PR.
Related Issues:
- [C++] Filesystem implementation for Azure Blob Storage #18014 (is a child of)
Component(s)
C++