Create directory

Hi @TheGod,

  1. I believe you need to run the app unsanboxed in order to create new directories.
    See my post here: Unable to make new directories within Legato app - #3 by raf
    Having sandboxed: false was the only way it worked.

  • For persistent data storage:
    I’ve used the same path and mounted an SD card at /mnt/userrw/sd.
    If you are going to be storing lots of files or doing lots of write/erase operations on the module’s non-volatile Flash memory, be conscious of Flash wear (finite write/erase cycles - typically 100000). You may want to consider external memory.

  • For non-persistent data storage (wiped on power cycle):
    Use /tmp - this is mapped to the module’s RAM so there’s no concern over Flash wear here.

  1. See: le_dir.h File Reference - Legato Docs
    le_dir_Make will return LE_DUPLICATE if the directory already exists. Try using le_dir_MakePath instead.

Raf

1 Like