ravi kiran
ravi kiran

Reputation: 371

Azure Datalake Store Create an empty file with C#

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

Answers (1)

saveenr
saveenr

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

Related Questions