Set readable

I have this code, set to umask(0000), how can I change it to be readable after it’s created

 public function generatefiles(){
	   code here creting files and directories	



Thank you

are you perhaps instead trying to chmod ?

Hi actually that code is from the previous developer, I don’t know why he used that maybe he is doing chmod?. but how can I make it to only readable after the files/dirctory is being created. actually that files resides in that directory that is being created will be attached to email and send it to the users. please help me.

Thank you.

well, 0000 means it wont be readable by anyone.

the question is who does it need to be readable by afterward?
the general form for non-executed files would be 0644; which means the owner can read/write, and everyone else can read.

Executable files can be set to 0755 (though technically, non-executable files can be given this mask as well), which says that the owner can write, and everyone can read and execute.

The ‘loosest’ permission mask is 0777, which means anyone can read (4), write (2) and execute (1) the file (4+2+1).

when we say execute a file what does it means ?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.