Skip to main content
Graduate
September 4, 2024
Solved

Azure FileX how to create directory with sub folders

  • September 4, 2024
  • 1 reply
  • 859 views

I can use the fx_directory_create() api to create a single directory level.  However I cannot seem to create a directory with sub folders with a single call.  For example, I can create the directory "TestDirectory", but I cannot create "TestDirectory/Folder1".  The API example shows only a single level, but I could do such a thing with FAT FS f_mkdir() so the presumption is I can do this with fx_directory_create(), however all that I have tried have not work.  Can anyone tell me if this is possible and if so, what should the syntax be for the directory name string. 

 

Thanks,

Hab

    This topic has been closed for replies.
    Best answer by Andrew Neil

    @Hab Collector wrote:

     I can create the directory "TestDirectory", but I cannot create "TestDirectory/Folder1". 


    So do it as a 2-step process:

    1. create the upper directory "TestDirectory";
    2. create the subdirectory "Folder1" within the newly-created "TestDirectory"

     


    @Hab Collector wrote:

    I could do such a thing with FAT FS f_mkdir() so the presumption is I can do this with fx_directory_create(),


    You can't just presume that; if Azure FileX only describes doing one level at a time, that's presumably the way you have to do it?

    FatFs is an entirely different project by an entirely different author.

     

    1 reply

    Super User
    September 4, 2024

    @Hab Collector wrote:

     I can create the directory "TestDirectory", but I cannot create "TestDirectory/Folder1". 


    So do it as a 2-step process:

    1. create the upper directory "TestDirectory";
    2. create the subdirectory "Folder1" within the newly-created "TestDirectory"

     


    @Hab Collector wrote:

    I could do such a thing with FAT FS f_mkdir() so the presumption is I can do this with fx_directory_create(),


    You can't just presume that; if Azure FileX only describes doing one level at a time, that's presumably the way you have to do it?

    FatFs is an entirely different project by an entirely different author.