2
votes

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.

1

1 Answers

1
votes

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);