Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
* How to set correct mode using mkdir(2) in C?
@ 1996-07-03  4:00 David Yuan
  1996-07-08  4:00 ` Yaacov Fenster
  0 siblings, 1 reply; 2+ messages in thread
From: David Yuan @ 1996-07-03  4:00 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to set correct mode using mkdir(2) in C?
  1996-07-03  4:00 How to set correct mode using mkdir(2) in C? David Yuan
@ 1996-07-08  4:00 ` Yaacov Fenster
  0 siblings, 0 replies; 2+ messages in thread
From: Yaacov Fenster @ 1996-07-08  4:00 UTC (permalink / raw)



In article <4re9nl$eb1@news.internetmci.com>
dyuan@win20.rch.mci.com (David Yuan) wrote:

> -------------------------------------------
>  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.

I just now tried it after doing a umask(0) first (On both V3.2C and V4.0),
and I had no problem at all. Could you please post a full snippet of
code showing the problem ?

	Yaacov




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-07-08  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-07-03  4:00 How to set correct mode using mkdir(2) in C? David Yuan
1996-07-08  4:00 ` Yaacov Fenster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox