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 not IsDeleted() 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:
Component(s)
C++
Describe the enhancement requested
Implement
Result<FileInfo> AzureFileSystem::GetFileInfo(const std::string& path).Logic I suggest we apply:
AzurePath.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.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.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:
Component(s)
C++