From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,65a8115b1650088,start X-Google-Attributes: gidf678f,public X-Google-Thread: fee84,65a8115b1650088,start X-Google-Attributes: gidfee84,public From: dyuan@win20.rch.mci.com (David Yuan) Subject: How to set correct mode using mkdir(2) in C? Date: 1996/07/03 Message-ID: <4re9nl$eb1@news.internetmci.com>#1/1 X-Deja-AN: 163514070 organization: MCI, Dallas newsgroups: comp.unix.osf.osf1,comp.unix.osf.misc Platform: DEC Alpha running Digital UNIX v.3.2c Problem: Using mkdir (2) call to create a directory with specific mask for permision. What i want is to use mkdir to create a directory with owner and group read, write, and execute permision by using: ------------------------------------------- char mydir[] = "/tmp/data"; mode_t mode = S_IRWXU | S_IRWXG; mkdir (mydir, mode); ------------------------------------------- but the result is: drwxr-x--- 2 dyuan system 512 Jul 3 12:03 /tmp/data/ The group is not writable. I also try to use umask (2) without luck. someone who knows how to correctly give the mode value to set group and owner read, write, and execute permission please let me know. thanks, David -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ David Yuan MCI Telecommunications Corporation 901 International Pkwy. || Office Number: 214 498 1129