Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > directorys

Reply
Thread Tools

directorys

 
 
Robin
Guest
Posts: n/a
 
      01-06-2004
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


 
Reply With Quote
 
 
 
 
Simon Taylor
Guest
Posts: n/a
 
      01-06-2004
Robin wrote:
> 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


 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      01-06-2004
Robin wrote:
> 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.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      01-06-2004
Robin <(E-Mail Removed)> wrote:

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


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
Robin
Guest
Posts: n/a
 
      01-09-2004
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

"Robin" <(E-Mail Removed)> wrote in message
news:btdkrv$qeg$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Robin
Guest
Posts: n/a
 
      01-09-2004
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

"Robin" <(E-Mail Removed)> wrote in message
news:btdkrv$qeg$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Ben Morrow
Guest
Posts: n/a
 
      01-09-2004

"Robin" <(E-Mail Removed)> wrote:
> 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

--
Although few may originate a policy, we are all able to judge it.
- Pericles of Athens, c.430 B.C.
(E-Mail Removed)
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      01-09-2004
Robin <(E-Mail Removed)> wrote:

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

--
Tad McClellan SGML consulting
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help getting file names from directorys on windows. Harry Nash Ruby 1 01-18-2009 04:33 PM
creating directorys kim MCAD 3 08-01-2006 01:47 AM
Accessing Directorys Thomas Brendgen C++ 4 02-27-2005 10:21 AM
How can I have list of Directorys and Files with Java BONITS Java 2 01-13-2004 10:41 PM



Advertisments