iLTC Home
Bookmark iLTC!
iLTC Google Boards

Google Groups
Receive The Code in Email!



Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • I love the code... dot com
    20,096

    iLoveTheCode.com
    Perl > Perl Tutorials How To Easy > Use chmod in Perl

    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



    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Making a Directory Using mkdir in Perl
    Next Article: Delete a File Using unlink in Perl





    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39

    Struts 2 in ActionStruts 2 in Action

    Don Brown, Chad Da...

    New $29.69

    CSS MasteryCSS Mastery

    Andy Budd, Simon C...

    New $23.09

    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $29.69

    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    JavaScriptJavaScript

    David Flanagan

    New $31.49

    Bulletproof Web DesignBulletproof Web Design

    Dan Cederholm

    New $26.39

    CSSCSS

    David McFarland

    New $23.09


    Of Interest:
  • Check for Existing File in Perl
  • Write a WHILE LOOP in Perl, Carefully
  • Write a FOR LOOP in Perl
  • Create or Put Items into an Array in Perl
  • Splitting an Array using Javascript
  • Close Window with window.close in Javascript
  • Javascript Focus Form Field
  • Write a For Loop in Javascript
  • Make Strikethrough Text Using HTML
  • HTML Tags
  • HTML Center
  • Make Text Bold Using HTML

  • More Articles:
  • Renaming a File with Perl's RENAME Function
  • Create or Put Items into an Array in Perl
  • What Environmental Variables are Available
  • INCREMENT and DECREMENT a Variable in Perl
  • onClick Javascript
  • Select All or Highlight Text Fields and Textareas Using Javascript
  • Close Window with window.close in Javascript
  • Opening a REMOTE WINDOW in Javascript
  • Reading Cookies using Javascript
  • HTML Space
  • HTML Color Codes
  • HTML Title Tag
  • HTML Tags

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    316,836
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:17 EDT