i have my script set up so that everyone who registers is added to the users txt file and a directory folder is created for them

how can i make th created directories with writing permissions so i can have it write the user and pass to the users.txt and write the first name last name and email to the directory folder?