Reputation: 371
How to create an empty file on Azure Data lake with C#. In one of the thread Create File From Azure Data Lake Store .NET SDK its mentioned to use- FileSystemOperationsExtensions.Create but how to use this to create an empty file.
Upvotes: 2
Views: 721
Reputation: 8619
Below is a snippet sample that accomplishes this:
// 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);
Upvotes: 1