adlfs icon indicating copy to clipboard operation
adlfs copied to clipboard

[feature request] support making directories beyond top-level containers

Open matt-erhart opened this issue 3 years ago • 1 comments

Current state from the doc for mkdir(): Mkdir is a no-op for creating anything except top-level containers. This aligns to the Azure Blob Filesystem flat hierarchy"

Datalake handles a nested dir structure with https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-namespace Also see: https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-directory-file-acl-python

Feature request is to support making directories beyond top-level containers.

matt-erhart avatar May 03 '22 21:05 matt-erhart

One way to do it:

import os, uuid, sys
from azure.storage.filedatalake import DataLakeServiceClient
from azure.core._match_conditions import MatchConditions
from azure.storage.filedatalake._models import ContentSettings
storage_account_name = 'testname'
service_client = DataLakeServiceClient(account_url="https://{storage_account_name}.dfs.core.windows.net")\
    .from_connection_string(conn_str=connection_string)

container_name = 'testcontainer'
file_system_client = service_client.get_file_system_client(file_system=container_name)
file_system_client.create_directory("my_directory/level1/level2")

matt-erhart avatar May 03 '22 22:05 matt-erhart