Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: chmod in perl

by atcroft (Monsignor)
on Mar 11, 2011 at 04:33 UTC ( #892584=note: print w/ replies, xml ) Need Help??


in reply to chmod in perl

Have you checked the return status of the chmod command? For instance,

my $filename = q{deletefiles.txt}; chmod 0777, $filename or die $!; open my $OUTPUT, q{+>}, $filename or die $!;

Hope that helps.

Update: 2011-03-11

Fixed missing semicolon on line 2 of code example causing error referred to in Re^2: chmod in perl.


Comment on Re: chmod in perl
Download Code
Re^2: chmod in perl
by Anonymous Monk on Mar 11, 2011 at 06:18 UTC

    I am getting the following error with the above code

    my $filename = q{deletefiles.txt}; chmod 0777, $filename or die $! open my $OUTPUT, q{+>}, $filename or die $!; Missing comma after first argument to die function at perl.pl line 135 +, near "$filename or" Execution of qdepot_upload.pl aborted due to compilation errors.
      You miscopied the code.

        Actually, I did. I fixed it, and put a note at the bottom to indicate it had been updated, but have no idea if the OP has seen it or tried with the missing semicolon in place.

      Try and put the semicolon after first die statement. Because of that its throwing that error because it's gonna continue till the end of file if you dont specify where to exactly end.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://892584]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2014-07-24 05:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (157 votes), past polls