CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
mkdir - how do you use it

 



ee91gg
Deleted

Apr 20, 2000, 5:05 AM

Post #1 of 3 (483 views)
mkdir - how do you use it Can't Post

I need to create directories in by script, but what is the format of the second argument? The manpages say that the format is that of umask, but what's that? I've already tried 755, '755', 0755, etc.. but i keep getting a zivide-by-zero type error


perlkid
stranger

Apr 20, 2000, 6:11 AM

Post #2 of 3 (483 views)
Re: mkdir - how do you use it [In reply to] Can't Post

 
I just read up on it and from what I undrstand umask is just short for the Unix Permission Mask, and the Unix Permission Mask is simply the permission. But to set a permission when using the mkdir you have to use permissions that are only similar to the ones that we really use like, 777, 755, and 666. 666 is 0666, 777 is 0777, and 755 is 022.

I was also suprise that 022 would be 755 but I just read it in two different books. Perl Cookbook, and Mastering Perl 5. Don't buy the second one.

I went to perl.com and I didn't find much other than what I read and told you but if you want to see go ahead, http://www.perl.com/cgi-bin/msearch.pl?searchfor=permission and
http://www.perl.com/cgi-bin/msearch.pl?searchfor=umask

perlkid


Cure
User

Apr 20, 2000, 7:05 AM

Post #3 of 3 (483 views)
Re: mkdir - how do you use it [In reply to] Can't Post

Hi

$dir = 'cure'; #the name of the directory is cure
mkdir $dir,'0755';
chmod(0755, $dir);


Cure

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives