Position actuelle: Accueil> Catégories de fonctions> chmod

chmod

Modifier le mode fichier
Nom:chmod
Catégorie:Système de fichiers
Langage de programmation:php
Description en une ligne:Modifier le mode fichier.

Exemple

 <span class="token php language-php"><span class="token delimiter important"><? Php</span>
<span class="token comment">// Le propriétaire peut lire et écrire, et d&#39;autres n&#39;ont aucune autorisation</span>
<span class="token function">chmod</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">,</span> <span class="token number">0600</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>

<span class="token comment">// Le propriétaire peut lire et écrire, et d&#39;autres peuvent lire</span>
<span class="token function">chmod</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">,</span> <span class="token number">0644</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>

<span class="token comment">// Le propriétaire a toutes les autorisations, qui peuvent être lues et exécutées par tout le monde</span>
<span class="token function">chmod</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">,</span> <span class="token number">0755</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>

<span class="token comment">// Le propriétaire a toutes les autorisations, et le groupe où le propriétaire est situé peut être lisible</span>
<span class="token function">chmod</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"test.txt"</span> <span class="token punctuation">,</span> <span class="token number">0740</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>
Fonctions similaires
  • Obtenez l'inode du fichier fileinode

    fileinode

    Obtenezl'inodedu
  • Changer le groupe auquel appartient le fichier chgrp

    chgrp

    Changerlegroupeauque
  • Obtenez des informations sur le fichier via le pointeur de fichier ouvert fstat

    fstat

    Obtenezdesinformatio
  • Écrivez dans des fichiers (utilisés en toute sécurité dans les fichiers binaires) fwrite

    fwrite

    Écrivezdansdesfichie
  • Synchroniser les données (mais pas les métadonnées) à un fichier fdatasync

    fdatasync

    Synchroniserlesdonné
  • Groupe de fichiers obtenus filegroup

    filegroup

    Groupedefichiersobte
  • Fournir des informations sur le document stat

    stat

    Fournirdesinformatio
  • Former la ligne vers CSV et écrire sur le pointeur de fichier fputcsv

    fputcsv

    FormerlaligneversCSV