linotp.lib.fs_utils module¶
File system utility functions.
- linotp.lib.fs_utils.ensure_dir(app, what: str, conf_name: str, *sub_dirs: str, mode: int = 504) str ¶
Make sure the directory whose name is given by app.config[conf_name]/sub/dirs exists. If it needs to be created, create all its parents if necessary, and use mode mode. app.config[conf_name] must exist in any case. Return dirname. Use what to describe what sort of directory you’re creating; this will show up in the log if there is an error.