directorys

R

Robin

How would I set chmod on a directory without making one and without using
exec or system...and how would I and what is a SUID bit for mkdir ("test",
0755)
is in the first number?

-Robin
 
S

Simon Taylor

Robin said:
How would I set chmod on a directory without making one and without using
exec or system...and how would I and what is a SUID bit for mkdir ("test",
0755)
is in the first number?

-Robin

The general solution is to use the chmod() function, see:

perldoc -f chmod

Here's a sample:

chmod 0600, $dir;

I'm sorry but I don't understand the second part of your question.

Regards,

Simon Taylor
 
G

Gunnar Hjalmarsson

Robin said:
How would I set chmod on a directory without making one and without
using exec or system...

You would do as the documentation for the chmod() function suggests.
 
T

Tad McClellan

Robin said:
How would I set chmod on a directory without making one and without using
exec or system...


perldoc -f chmod


Is it possible that you didn't even look for a like-named function?
 
R

Robin

the book I have said it works for files, and I was assuming it didn't work
for directories...

thanks a lot, appreciate it,

-Robin
 
R

Robin

another thing, is it just
$nameofdir = "somedirectory/"
-e "$nameofdir"

(not that this code runs)
or likewise filetest operator to test on a directory?

Thanks,
-Robin
 
B

Ben Morrow

Robin said:
another thing, is it just
$nameofdir = "somedirectory/"
-e "$nameofdir"

(not that this code runs)
or likewise filetest operator to test on a directory?

A directory *is* a file. Anything that works on a file works on a
directory (with the exception of opening it for writing).

Ben
 
T

Tad McClellan

Robin said:
another thing, is it just
$nameofdir = "somedirectory/"
-e "$nameofdir"


No, it is: -e $nameofdir


perldoc -q vars

What's wrong with always quoting "$vars"?



[snip TOFU. Please learn the proper way of quoting followups]
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,526
Members
44,997
Latest member
mileyka

Latest Threads

Top