mkdir and ownership of directory
Posted: Sat Aug 21, 2010 4:11 am
Hi all,
I'm new to permissions and ownership of files/folders.
I would like to create a new folder for each inidividual user that registers on my website, this folder will store their upload profile pictures, testimonials, certificates etc.
So for a user with user id 912, I'll create a folder: client_profile/912/
A profile picture will have the path: client_profile/912/912_profile_pic.jpg
I'm using the following to create the folder
That creates a folder that sets permission to 0755, and has owner set to 80, group as 1646.
1) I know what's 0755, but why is it created with 0755 permission when i used 0777 in my mkdir function?
Well the problem here is that, I'm using an ftp client to look at my directories, and it seems i am not allowed to delete/move/rename/paste files that are in folders that have owner set to 80. Or maybe there are other factors, but i should say that's the only difference I can see between folders which have this problem and folders that don't. Folders that I manually created through my ftp client have owner set to 1646, these folders have no such problem.
2) Can anyone explain to me what does the owner and group code means?
3) As the site admin shouldn't I have access to every file on the site?
4) If ownership of 80 is indeed the problem here, can I create the directory with ownership set to 1646?
Many thanks in advance!
I'm new to permissions and ownership of files/folders.
I would like to create a new folder for each inidividual user that registers on my website, this folder will store their upload profile pictures, testimonials, certificates etc.
So for a user with user id 912, I'll create a folder: client_profile/912/
A profile picture will have the path: client_profile/912/912_profile_pic.jpg
I'm using the following to create the folder
Code: Select all
mkdir ($uploadsDirectory, 0777);1) I know what's 0755, but why is it created with 0755 permission when i used 0777 in my mkdir function?
Well the problem here is that, I'm using an ftp client to look at my directories, and it seems i am not allowed to delete/move/rename/paste files that are in folders that have owner set to 80. Or maybe there are other factors, but i should say that's the only difference I can see between folders which have this problem and folders that don't. Folders that I manually created through my ftp client have owner set to 1646, these folders have no such problem.
2) Can anyone explain to me what does the owner and group code means?
3) As the site admin shouldn't I have access to every file on the site?
4) If ownership of 80 is indeed the problem here, can I create the directory with ownership set to 1646?
Many thanks in advance!