iLTC Home
Bookmark iLTC!

Categories

Perl
  • Perl Tutorials Beginners

  • Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

  • HTML
  • HTML Tutorials

  • Command Line
  • Command Line Tutorials

  • How Tos
  • Other Tips and Tricks



  • #!/usr/bin/perl
    2210872

    iLoveTheCode.com

    Use chmod in Perl

    chmod(0777, "hohofiles") || print $!;

    This will change the permissions of our directory hohofiles to 777.


    -We called Perl's built-in chmod function.
    -We set permissions to 777.
    -We enclosed the name of the thing to be chmoded in quotation marks. This could have also included the path to hohofiles if it was in a different directory than our script.
    -We included two vertical bars or pipes, which mean "or".
    -We said to print any error we might receive. The errors are contained in the built-in variable $!

    -Summary: chmod our directory or print errors.




    Copy and Paste Perl Code:

    #!/usr/bin/perl

    print "Content-type:text/html\n\n";

    chmod(0777, "hohofiles") || print $!;

    print " -Done";

    exit;



    Resources:
    Use the Perl PRINT FUNCTION
    Making a Directory Using mkdir in Perl





    Previous Article: Making a Directory Using mkdir in Perl
    Next Article: Delete a File Using unlink in Perl






    Search iLTC w/ Google




    Recent Articles

  • HTML Font Code
  • Javascript and CSS - Easy Pop Up Help Balloons
  • Use OnMouseOver in Javascript
  • Use onMouseOut in Javascript
  • Use innerHTML to Change Text on a Page
  • Renaming a File with Perl's RENAME Function
  • PRINT to Browser with document.write Command in Javascript
  • Passing an Argument or Variable to a Javascript
  • Opening an Alert Box in Javascript
  • Opening a REMOTE WINDOW in Javascript
  • OPEN and WRITE a Data File in Perl
  • OPEN and READ a Data File in Perl
  • Mimic Typing from a Textfield in a Textarea with Javascript
  • Javascript Reset Form








  • Perl Programming - Javascript Programming - HTML Code - Mac Unix Command Line - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006-2009 iLoveTheCode.com


    Contact Chris | About this Site


    2210083
    Counter by iLoveTheCode.com


    Last Modified: Saturday, 10-Jan-2009 05:40:25 EST



    Hosted as well :)
    Home-brewed logo - 1997