如何使用C#在Azure Data湖上创建空文件。在其中一个提到的线程Create File From Azure Data Lake Store .NET SDK中使用了FileSystemOperationsExtensions.Create但是如何使用它来创建一个空文件。
答案 0 :(得分:1)
以下是完成此操作的代码段示例:
// to find out how to get the credentials...
// see: https://github.com/Azure-Samples/data-lake-analytics-dotnet-auth-options
var adlCreds = ...;
string adls = "youradlsaccountname";
var adlsFileSystemClient = new DataLakeStoreFileSystemManagementClient(adlCreds);
var adlsaccount = adlsAccountClient.Account.Get(rg, adls);
adlsFileSystemClient.FileSystem.Create( adls, "/emptyfile.dat", null, null, null,null,null);