title: ColdFusion Folder Permission becomes read only
body: <p>Running ColdFusion 10 currently, but this has been an ongoing issue for years, perhaps throughout CF6/7.</p>
  
  <p>As part of a CMS, part of the validation is that the images are uploaded to a directory e.g.</p>
  
  <pre><code>&lt;cffile action="UPLOAD" filefield="image" destination="media/img/" nameconflict="MAKEUNIQUE" accept="image/jpeg,image/gif,image/pjpeg" mode="644"&gt;
  </code></pre>
  
  <p>They are then read by a script which checks dimensions.</p>
  
  <p>If everything passes, the process script moves it to it's destination directory e.g.</p>
  
  <pre><code>&lt;cffile action="MOVE" source="media/img/imagename" destination="media/img/#hexdir#/imagename" mode="644"&gt;
  </code></pre>
  
  <p>If it fails it should be deleted.</p>
  
  <pre><code>&lt;cffile action="DELETE" file="media/img/imagename"&gt;
  </code></pre>
  
  <p>Every once in a while the /img/ directory becomes read only, the file cannot be written. But I cannot identify the cause of this.</p>
  
  <p>Is there a bug that I am not aware of? any ideas?</p>
  
  <p>Thanks</p>
  
  <p><strong>Additional information</strong></p>
  
  <p>I considered using CFDirectory to change the folder permission in a script, so it can be quickly resolved if it happens again.</p>
  
  <p>I found two issues</p>
  
  <blockquote>
    <p>On UNIX and Linux, cfdirectory action = "list" does not return any information in the mode column.</p>
  </blockquote>
  
  <p>Also</p>
  
  <p>Using the rename folder with permissions of 644,777,111 do not seem to affect the permissions of the folder that I can view in FileZilla.</p>
  
  <p>Could this mean that CF could not have changed the folder permission in the first place?</p>