使用python将文件从azure data lake Gen 1移动到临时目录

使用python将文件从azure data lake Gen 1移动到临时目录,python,azure-data-lake,Python,Azure Data Lake,如何使用python将文件从azure data lake Gen 1移动到临时目录? 我需要找到ADL中的每个文件,将其移动到temp目录中,对其进行解密并读取 我正在使用 azure.datalake.store import core core.AzureDLFileSystem(token, 'store_name') #create a temp directory with tempfile.TemporaryDirectory() as tmpdirname: 关于该问题,请

如何使用python将文件从azure data lake Gen 1移动到临时目录? 我需要找到ADL中的每个文件,将其移动到temp目录中,对其进行解密并读取

我正在使用

azure.datalake.store import core
core.AzureDLFileSystem(token, 'store_name')

#create a temp directory
 with tempfile.TemporaryDirectory() as tmpdirname:

关于该问题,请参考以下代码

from azure.datalake.store import core, lib, multithreaded

##auth
adlCreds = lib.auth(tenant_id = tenant,
                client_secret = client_secret,
                client_id = client_id,
                resource = RESOURCE)
subscriptionId = 'FILL-IN-HERE'
adlsAccountName = 'FILL-IN-HERE'

## Create a filesystem client object
adlsFileSystemClient = core.AzureDLFileSystem(adlCreds, store_name=adlsAccountName)


## Download a file
multithread.ADLDownloader(adlsFileSystemClient, lpath='<local path>', rpath='<path on adls>', nthreads=64, overwrite=True, chunksize=4194304,buffersize=4194304, blocksize=4194304)

##Move file between locations on ADL
adlsFileSystemClient.mv('<Source Path>','Destination path')
来自azure.datalake.store导入核心、库、多线程
##认证
adlCreds=lib.auth(租户id=tenant,
客户机密=客户机密,
客户号=客户号,
资源=资源)
subscriptionId='FILL-IN-HERE'
adlsAccountName='FILL-IN-HERE'
##创建文件系统客户机对象
adlsFileSystemClient=core.AzureDLFileSystem(adlCreds,store_name=adlsAccountName)
##下载文件
多线程.ADLDownloader(adlsFileSystemClient,lpath='',rpath='',nthreads=64,overwrite=True,chunksize=4194304,buffersize=4194304,blocksize=4194304)
##在ADL上的位置之间移动文件
adlsFileSystemClient.mv(“”,“目标路径”)

有关更多详细信息,请参阅和

您能否详细描述您的问题?你说的临时目录是什么意思?本地磁盘上的目录?嗨,吉姆,是的,我正在本地磁盘上创建临时目录。我更新了问题。谢谢吉姆,这应该行得通。我会让你知道事情的进展。