davlee1972 commented on issue #50073:
URL: https://github.com/apache/arrow/issues/50073#issuecomment-4652651513

   I'm not a C++ programmer, but looking through the C++ code in:
   
   https://github.com/apache/arrow/blob/main/cpp/src/arrow/filesystem/azurefs.cc
   
   Couldn't we replace any instances of file_client.GetProperties() with 
AzureFileSystem::GetFileInfo()?
   
   ```
         // This is necessary to avoid deletion of directories via DeleteFile.
         auto properties = file_client.GetProperties();
         if (properties.Value.IsDirectory) {
           return internal::NotAFile(location.all);
         }
   
   ```
   
   ```
   Result<FileInfo> AzureFileSystem::GetFileInfo(const std::string& path) {
     ARROW_ASSIGN_OR_RAISE(auto location, AzureLocation::FromString(path));
     if (location.container.empty()) {
       DCHECK(location.path.empty());
       // Root directory of the storage account.
       return FileInfo{"", FileType::Directory};
     }
     if (location.path.empty()) {
       // We have a container, but no path within the container.
       // The container itself represents a directory.
       auto container_client = 
impl_->GetBlobContainerClient(location.container);
       return GetContainerPropsAsFileInfo(location, container_client);
     }
     return impl_->GetFileInfoOfPathWithinContainer(location);
   }
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to