Until the todo gets in, please add a comment what `0755` is.
Since you re-use `phaseSpace` when accessing the directory for writing, you might want to `#define` that somewhere common?