Skip to main content
Hab Collector
Associate III
September 4, 2024
Solved

Azure FileX how to create directory with sub folders

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.
    Andrew Neil
    Andrew NeilBest answer
    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.

     

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.

    1 reply

    Andrew Neil
    Andrew NeilBest answer
    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.

     

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.