gid and uid of process must be setted before of directory creations.