Computing.Net > Forums > Web Development > use PERL to create folder

use PERL to create folder

Reply to Message Icon

Original Message
Name: jackwong
Date: January 8, 2005 at 15:50:15 Pacific
Subject: use PERL to create folder
OS: winXP
CPU/Ram: 256MB
Comment:

Hello,

Is there a way that I can use PERL to creat a new folder on a server? So I don't have to creat the folder by hand. Any help will be appericated!

Jack


Report Offensive Message For Removal

Response Number 1
Name: FishMonger
Date: January 10, 2005 at 18:23:26 Pacific
Subject: use PERL to create folder
Reply: (edit)

Do you mean other than the mkdir command?

C:\>perldoc -f mkdir
mkdir FILENAME,MASK
mkdir FILENAME
Creates the directory specified by FILENAME, with permissions specified by MASK (as modified by "umask"). If it succeeds it returns true, otherwise it returns false and sets $! (errno). If omitted, MASK defaults to 0777.

In general, it is better to create directories with permissive MASK, and let the user modify that with their "umask", than it is to supply a restrictive MASK and give the user no way to be more permissive. The exceptions to this rule are when the file or directory should be kept private (mail files, for instance). The perlfunc(1) entry on "umask" discusses the choice of MASK in more detail.

Note that according to the POSIX 1003.1-1996 the FILENAME may have any number of trailing slashes. Some operating and filesystems do not get this right, so Perl automatically removes all trailing slashes to keep everyone happy.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: use PERL to create folder

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software