<?xml version="1.0" encoding="windows-1252"?>
<node id="1005083" title="PERL chmod inconsistent with the LINUX equivalent" created="2012-11-22 04:18:49" updated="2012-11-22 04:18:49">
<type id="115">
perlquestion</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
&lt;p&gt;
Hello all.
I am trying to run chmod (and check for failures), using PERL.
The chmod returns 1, but the permissions reported are different than the ones reported after using LINUX's chmod.
I have used perl -e to show the inconcictency.
See below:
&lt;code&gt;
&gt; perl -e '$m= chmod (777 , "run.debug.2.log")  ; print "$m\n";'
1
&gt; ls -ltr run.debug.2.log
-r----x--x 1 ldagan contract 0 Nov 22 08:59 run.debug.2.log
&gt; chmod 777 run.debug.2.log
&gt; ls -ltr run.debug.2.log
-rwxrwxrwx 1 ldagan contract 0 Nov 22 08:59 run.debug.2.log
&lt;/code&gt;
&lt;p&gt;
As can be seen, chmod 777 in PERL gives  permsissions "-r----x--x", which is different than the LINUX equivalent.
Any ideas?
&lt;/p&gt;</field>
<field name="reputation">
4</field>
</data>
</node>
