none
Example of AdlsClient.Rename in C#

    Question

  • Hi all,

    I'm trying to rename an existing file in ADLS gen1.  I can see the method I need in the MS documentation, but there is no example.  And a web search returns no hits other than the MS doc.

    Docs here:

    https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.datalake.store.adlsclient.rename?view=azure-dotnet

    Basically I need to know what values go in 'path' and 'destination'?  Common sense would dictate that 'path' is the old filepath + filename within ADLS, and 'destination' is the same filepath + new file name.  But when I try that the file does not rename.

    I've tried Rename and RenameAsync - neither work. And with 'overwrite' set to true and false - doesn't make a difference.  No errors returned, just the file does not get renamed.

    If anyone has a working example in C# they're willing to share then that would be awesome!

    Thanks


    • Edited by JohnNev Tuesday, May 7, 2019 3:39 PM Mentioned 'overwrite' param
    Tuesday, May 7, 2019 3:37 PM

Answers

All replies

  • Problem solved!

    I used a DataLakeStoreFileSystemManagementClient instead.

    • Marked as answer by JohnNev Tuesday, May 7, 2019 5:00 PM
    Tuesday, May 7, 2019 5:00 PM
  • Hi JohnDev,

    Glad to know that your issue has resolved. And thanks for sharing the solution, which might be beneficial to other community members reading this thread. 

    Wednesday, May 8, 2019 4:16 AM
    Moderator