Dir.mkdir

P

paul vudmaska

I'm attempting to make a script that creates directories on a bsd
server.

#needs write privs to the server(for uploading from web)
/upload
#just write to owner
/htm

For the first, i'm using
owner - all privs = 07
group - read,write = 6
other - read = 4

Dir.mkdir('upload', 0764)
Which, when looking at with ls -al
shows
drwxr--r--
all privs to owner, read to group and nothing to other

This seems to work ok for files, just not dirs.

What mask do i need to allow the server to write to dirs??

//from doc
//Higher-order bits may also be used to indicate the type of file
(plain, //directory, pipe, socket, and so on)

What higher-order bits?

Someone clue me if you have a chance.



Paul

/* -----------------------------cut from docs
In this section, permission bits are a platform-specific set of bits
that indicate permissions of a file. On Unix-based systems,
permissions are viewed as a set of three octets, for the owner, the
group, and the rest of the world. For each of these entities,
permissions may be set to read, write, or execute (or search, if a
directory) the file:
*/
 
M

Mark Hubbart

I'm attempting to make a script that creates directories on a bsd
server.

#needs write privs to the server(for uploading from web)
/upload
#just write to owner
/htm

For the first, i'm using
owner - all privs = 07
group - read,write = 6
other - read = 4

Dir.mkdir('upload', 0764)
Which, when looking at with ls -al
shows
drwxr--r--
all privs to owner, read to group and nothing to other

This seems to work ok for files, just not dirs.

What mask do i need to allow the server to write to dirs??

Is your umask causing the problem? I know mine is set by default to
0022, so it would mask off the group/world write bits.

"%04o" % File.umask
==>"0022"
File.umask 0
==>18
"%04o" % File.umask
==>"0000"

HTH,
--Mark
 
P

paul vudmaska

Mark Hubbart said:
Is your umask causing the problem? I know mine is set by default to
0022, so it would mask off the group/world write bits.

"%04o" % File.umask
==>"0022"
File.umask 0
==>18
"%04o" % File.umask
==>"0000"

HTH,
--Mark


Mucho, mucho, thanks Mark, using File.umask 0 worked. Now i need to figure out why.

:p, thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top