Click to See Complete Forum and Search --> : problems with mkdir


xavikevicious
December 3rd, 2004, 04:31 PM
hi !

when i want to create one directory with 0777 permissions with mkdir and then i want to delete these directory i can't do it with a "Permission denied" error as a reason. if i put 0777 when i create these directory why i have this error??

Thanks in advance

xavik

pd- I have a linux os in server

visualAd
December 4th, 2004, 03:49 AM
I am confused. Does it actually let you create the directory in the first place? Remember that when you create the directory the permissions you set on that directory are only rlelevant to subdirectories and files of that directory.

When creating and removing directories and files, you are actually modifying the parent directory and therefore need write permissions on that. If it is letting you create the directory but not delete it it, this is what to check:



Check the directory is empty. You cannot delete non empty directories.
Make sure the parent directory has write permissions.
Check the parent directory does not have the s bits set on the user and group. This will cause any new files or directories created to assume the identity (i.e.: the user / group) of its parent. A directory with the following permissions will allow the creation of a directory by anyone but not the deletion:



rwsrwsrwT = 7777



The 'T' indicates a sticky, which allows only the owner of the item being modified in the directory to modify it.

xavikevicious
December 17th, 2004, 05:34 PM
Finally i found the sollution->chmod function for every new directory.

thanks for help me

xavik