#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    5
    Rep Power
    0

    Unhappy


    How do I create a directory, directories for that matter, in Perl?

    TIA,

    Kyu
  2. #2
  3. Ole` Timer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    N.W. Iowa
    Posts
    472
    Rep Power
    14
    Assuming this is on a UN*X box, something like this would work:
    Code:
    mkdir("$path_to_new_folder");
    # Adjust chmod setting as needed
    chmod 0777, "$path_to_new_folder";
    unless (-w "$path_to_new_folder") {
    # Test if folder created
    # Generate an error, not a valid directory folder
    }
    Very basic Perl!

    Mickalo

    Thunder Rain Internet Publishing

    Custom Programming & Database development
    Providing Personal/Business
    Internet Solutions that work!

IMN logo majestic logo threadwatch logo seochat tools logo