From: dyuan@win20.rch.mci.com (David Yuan)
Subject: How to set correct mode using mkdir(2) in C?
Date: 1996/07/03 [thread overview]
Message-ID: <4re9nl$eb1@news.internetmci.com> (raw)
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
next reply other threads:[~1996-07-03 4:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-07-03 4:00 David Yuan [this message]
1996-07-08 4:00 ` How to set correct mode using mkdir(2) in C? Yaacov Fenster
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox